httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sharjeel Tariq <>
Subject [users@httpd] apache redirection does not work
Date Thu, 01 Oct 2009 15:53:15 GMT

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
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} ^$
RewriteRule ^/(.*)$$1 [L,R]

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

Instead of redirecting the above url to

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

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.


View raw message