httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Bakshi" <joyd...@infoservices.in >
Subject Re: [users@httpd] Solved non-www to www redirect works with a little issue
Date Fri, 25 May 2012 11:50:26 GMT

Solved :-)

RewriteRule ^(.*) http://www.example.com/%{REQUEST_URI} [R=301]


On Fri, 25 May 2012 16:23:29 +0530
"J. Bakshi" <joydeep@infoservices.in> wrote:

> Hello,
> 
> I have place the following in my .htaccess to redirect non-www to www redirection 
> 
> `````````````
> RewriteCond %{HTTP_HOST} ^example\.com$
> RewriteRule ^(.*) http://www.example.com/$1 [R=301]
> 
> ```````````````
> 
> The redirect work well but a little hitch.
> Say If I visit http://example.com/page1.html it redirect to
> http://www.example.com so at the home page. Where it should
> append the www before the link, but not alter the link.
> 
> What modification should I add here to make it work ?
> 
> Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message