how can i redirect www to non www for subdirectories .it is ok for home page but for subdirectories dont work . my subdyrectoris 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 only it affect home page not subdirectories .