.htaccess - rewrite htaccess to include www and include rest of url -
the following code reditrects user www, if www missing in url, how redrirect same url including www
rewriteengine on rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l]
eg above redirects:
mydomain.com/gohere/
to
www.mydomain.com
but redirect to
www.mydomain.com/gohere/
thanks in advance responders. j
try code:
options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / rewritecond %{http_host} !^www\. [nc] rewriterule ^ http://www.%{http_host}%{request_uri} [r=301,l]
make sure test in different browser or clear browser cache.
Comments
Post a Comment