How to Redirect http: to https: secure site

5 replies
  • SEO
  • |
Someone was kind enough to give me the code to redirect my http: site to a https: secure site which is:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.* [nocase]
RewriteRule ^(.*) hxxp://employeelocator.com/$1 [last,redirect=301]

But I think this causes a conflict with an existing .htaccess file that handles a 301 redirect for canonical error purposes.

Can anyone enlighten me as to how to do both please?
#http #https #redirect #secure #site
  • Profile picture of the author Lynker
    Why don't you use Rel=Canonical on page and 301 redirect for http to https.

    How does it conflict btw?
    Signature

    {{ DiscussionBoard.errors[8971333].message }}
    • Profile picture of the author paulgl
      Originally Posted by Lynker View Post

      Why don't you use Rel=Canonical on page and 301 redirect for http to https.

      How does it conflict btw?
      That has little to do with redirecting to a https...

      Talk to an expert at your host. They will do it right.

      FYI: Those recirects above are not secure. What would be the point? You'd
      be mixing and matching stuff up. And they probably would not work right.

      Of course I won't even ask why you feel the need to have a secure site...

      Is your hosting apache? Check this out: Smart HTTP and HTTPS .htaccess Rewrite
      But it's not for the faint of heart. I'd opt for some expert person at the server side
      setting it up.

      Paul
      Signature

      If you were disappointed in your results today, lower your standards tomorrow.

      {{ DiscussionBoard.errors[8971478].message }}
      • Profile picture of the author CKTaylor7
        Thanks for the response Paul. Unfortunately my ISP won't do this for me so I'm left trying to piece the solution together myself and its not my area of expertise. It needs to be a secure site because of confidential consumer data being submitted. Thanks.

        Originally Posted by paulgl View Post

        That has little to do with redirecting to a https...

        Talk to an expert at your host. They will do it right.

        FYI: Those recirects above are not secure. What would be the point? You'd
        be mixing and matching stuff up. And they probably would not work right.

        Of course I won't even ask why you feel the need to have a secure site...

        Is your hosting apache? Check this out: Smart HTTP and HTTPS .htaccess Rewrite
        But it's not for the faint of heart. I'd opt for some expert person at the server side
        setting it up.

        Paul
        {{ DiscussionBoard.errors[8974657].message }}
    • Profile picture of the author CKTaylor7
      Thanks for this response. I didn't do the 301 for the canonical issue, the ISP did. So what is the code you are referring to. Thanks for your help.

      Originally Posted by Lynker View Post

      Why don't you use Rel=Canonical on page and 301 redirect for http to https.

      How does it conflict btw?
      {{ DiscussionBoard.errors[8974654].message }}
  • Profile picture of the author patco
    Sometimes those certificates are pretty expensive... Are you sure your website need such a security... Also, just an advice, don't do anything if you don't know what will be the result!
    Signature

    A blog that will show you How to Lose Weight with a cool Quick Weight Loss guide...
    Also enjoy some of my favorite Funny pictures and photos that will make you smile :)

    {{ DiscussionBoard.errors[8974773].message }}

Trending Topics