I would like to force SSL and WWW to my domain and sub domain. Thanks for helping.
I've been using the below code. This code will force SSL and WWW in all conditions except below conditions
http://www.example.com to https://www.example.com
https://www.example.com/test.php to https://www.example.com/test
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [NC,L]
DirectoryIndex index.php index.html site-down.php
ErrorDocument 404 nofile
# DO NOT REMOVE THIS LINE AND THE LINES BELOW SSL_REDIRECT:example.com
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^examplea.com$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE SSL_REDIRECT:example.com
I need the code which also forces SSL, WWW and removes the page extension like .php Thank you