0

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 .

vo8091
  • 11
  • 2
  • Does this answer your question? [Generic htaccess redirect www to non-www](https://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www) – kmoser Aug 21 '21 at 06:47
  • Now what, subdirectories or subdomain? – arkascha Aug 21 '21 at 09:26

0 Answers0