Enquiry Email Form

More and more websites are making the move from http to https, primarily because of Google’s announcement back in August 2014, where they said websites with SSL (i.e. secure connection) will benefit from a slight boost in search engine rankings.

Many have made the move, yet failed to notice any difference in rankings. Perhaps the boost is so lightweight that it’s extremely difficult to track. In any case, I don’t see anything wrong with getting an SSL certificate, even if your website isn’t dealing with sensitive data or necessarily going to benefit from a boost, because it ultimately does make a website online essay writing service uk more secure when transferring data, and that’s always a good thing.

The code

The following code will 301 redirect all http URLs to https. For example http://www.example.com will redirect to https://www.example.com

1
2
3
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  1. 09/09/2015

    Hello,

    Question: When should I put this code? (file, directory, etc.). Thanks!

  2. Maruf
    15/10/2015

    Hi Juan,

    The code should go at the top of your .htaccess file, which should go in the root directory.

Learning & sharing

This is where we store some of our Web Development thoughts, tips and tricks for both our own uses and for others to learn from. Sharing is caring.

Please feel free to contribute to our blog posts; perhaps even teach us a few tricks of your own. We'd love to hear your thoughts.



X