If you own a website or an online business its important to make sure you spend enough time and resources looking at security.
Every website should have an SSL certificate, which stands for Secure Sockets Layer. This creates a secure encrypted connection using keys between your visitor and your website, this makes it harder for their session or data to be hijacked. More and more customers look for the secure padlock in the address bar, they might not not know exactly what it does, but its seen as a sign of trust, safety and security.
According to reports and evidence, websites that switch to SSL load upto 336% faster, which adds and improves to the users experience further.
Search engines like Google also factor in whether a website has an SSL certificate when determining search engine positions and rankings.
Once you have your SSL certificate setup you then need to redirect your visitors from http to https, again doing this automatically for them only adds to their overall user experience.
Htaccess code for http to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^urviral\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.urviral\.co\.uk$
RewriteRule ^/?$ "https\:\/\/urviral\.co\.uk\/" [R=301,L]
</IfModule>
When adding content to your htaccess file and using examples like mine, make sure you only have one RewriteEngine On and not multiple.
Also read the example code and make sure you change any urls to yours. In my example I am using code from another project as I have it open. Feel free to browse the site.
I will do a blog post on various other tips and tricks you can do with your htaccess file, like compression, expiration on content, hiding page extensions, redirects and various other bits and pieces.