Hi, how do I do this using .htaccess? If they enter www. or not I'd like them to be redirected to https://www.(or not) How do I make it so every single page on the website no matter what directories the files are in, so I can make the links http://www. and they redirect automatically to https://www. ? I realise I've probably talked a load of crap here but I know nothing about .htaccess but hopefully you can understand what I'm trying to do, thanks.
So I put just that in .htaccess in the main directory and will it redirect all pages to their file names or back to the main index?
RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteCond %{HTTP_HOST} ^(www\.)? RewriteRule (.*) https://%1yourdomain.com/$1 [R=301,L,NC] Code (markup): Line 1: turn rewrite engine on (self explanitory) Line 2: match the server port against 443 (default for SSL connection) Line 3: see if we requested www. (or not) and capture in backreference %1 Line 4: intercept all requests, redirect to requested page in https:// Hopefully that makes sense.