php - I'd like a url with Sub Directory and without www to redirect to same url with www -


example.com/category/ should redirect www.example.com/category/.

my .htaccess file below.

example.com/category/.htaccess :

options +followsymlinks rewriteengine on rewritebase /category/  rewriterule ^([0-9]+)(?:/[^/]+)?/?$ load.php?cat=$1 [l,qsa]  rewriterule ^([0-9]+)/[^/]+/[^/]+/([0-9]+)/?$ load.php?cat=$1&p=$2 [l,qsa] 

insert rule below rewritebase line:

rewritecond %{http_host} !^www\. [nc] rewriterule ^ http://www.%{http_host}%{request_uri} [r=301,ne,l] 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -