On Thu, 2009-10-01 at 11:53 -0400, Sharjeel Tariq wrote:<snip>
> 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]
>
Sharjeel,
I know it's not what you are asking for, but may accomplish your task.
You can try adding a ServerAlias to the VirtualHost:
ServerName example.com
ServerAlias www.example.com
Here is the documentation at apache site:
http://httpd.apache.org/docs/2.0/mod/core.html#serveralias
Sorry if it's not what you are asking for, but it's pretty much waht I'd
do. With a simple script you can manage to add the ServerAlias to all
the VirtualHosts.
Cheers,
Martin
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
" from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx