Hi,

I am trying to set up apache redirection rule for redirecting all of our non
'www' domains to 'www' domains. I got the redirection rule from apache
manual
but the rule does not work when we have subdirectories and parameters at the
end of url.

The redirection rule i have is


RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^/(.*)$ http://www.example.com/$1 [L,R]


The above rule works for all urls except when I have urls like

http://example.com/news/headlines/more.jsp?content=20090624_075115_6540

Instead of redirecting the above url to

http://www.example.com/news/headlines/more.jsp?content=20090624_075115_6540

It is redirecting it to home page of site with
"?content=20090624_075115_6540" at the end


http://www.example.com/index.jsp?content=20090624_075115_6540

I need a generic redirection rule to redirection all non 'www' urls to 'www'
urls. I have to apply this rule on almost 50 web sites.


Thanks,

Reply via email to