How can I redirect www
to non www
for sub-directories? It is OK for home page but for sub-directories, it doesn't work. My sub-directory files have dynamic content.
My .htaccess
is:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R]
RewriteRule blog/(.*)/ viewpost.php?page=$1
RewriteRule blog/(.*) catpost.php?page=$1
but it only affects the home page, not sub-directories.