APACHE .HTACCESS NON-WWWW TO WWW AND HTTP TO HTTPS REDIRECT FOR SUBDIRECTORIES TOO
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
Copy above code to .htaccess file and place it in your server root www folder.
This code will..
- Redirect non-www to www.
For example: thewebblinders.in to www.thewebblinders.in(with https) - Redirect http to https.
For example: http://thewebblinders.in to https://www.thewebblinders.in - Example for sub directories.http://thewebblinders.in/loveanalysis to https://www.thewebblinders.in/loveanalysis
ALTERNATE TITLES