How to Redirect http: to https: secure site

by 5 replies
6
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?
#search engine optimization #http #https #redirect #secure #site
  • Why don't you use Rel=Canonical on page and 301 redirect for http to https.

    How does it conflict btw?
    • [2] replies
    • 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
      • [1] reply
    • 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.

  • 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!

Next Topics on Trending Feed