httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krist van Besien" <krist.vanbes...@gmail.com>
Subject Re: [users@httpd] How to chain two rules
Date Fri, 01 Dec 2006 10:23:40 GMT
On 11/30/06, Norman Khine <norman@khine.net> wrote:
> Hello,
> Can someone please advise how to chain two rules together so that:
>
> [1]  <VirtualHost *:80>
> [2]   ServerName mysite.com
> [3]   ServerAlias www.mysite.com

> [4]   RewriteEngine On
> [5]   RewriteCond %{HTTP_HOST} ^www\.mysite\.info [nc]
> [6]   RewriteRule (.*) http://mysite.info/$1 [R=301,C]
> [7]   RewriteRule ^/(.*)
> [8]   http://mysite.com:5080/VirtualHostBase/http/mysite.com:80/sites/site/VirtualHostRoot/$1
> [L,P]
> [9]   ErrorLog /var/log/apache2/site_error.log
> [10]  CustomLog /var/log/apache2/site_access.log combined
> [11]  RewriteLog /var/log/apache2/site_rewrite_log
> [12] </VirtualHost>
>
>
> When I have this rule, and type http://www.mysite.com my requests don't
> go to the next rule. I have specified the 'C' flag which is the chain to
> next rule, all I get is:
>
>
>   Not Found
>
> The requested URL // was not found on this server.

Your problem might be that the requests don't get handled by the
virtual host block you quoted above.

The virtual server will only process requests were the "HOST" header
is mysite.com of www.mysite.conf (because of lines 2 and 3), unless it
is also the default virtual host for this server, but this I can't
judge.

I would do the following:

- Run httpd -S and look at the output, to see if this virtual host is
considered the default. If it is not, add "ServerAlias
www.mysite.info" to your virtual host def. Mybe you need to adde
"ServerAlias mysite.info" too.
- Add the directive "RewriteLogLevel 3" to your config, so your
rewrite log will contain something.

Krist

-- 
krist.vanbesien@gmail.com
Bremgarten b. Bern, Switzerland

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message