You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ken Schutte <ks...@csail.mit.edu> on 2006/08/01 23:59:04 UTC

[users@httpd] Can't get mod_rewrite to do anything

Hi,

I'm using apache2 on Debian, and have the following in
/etc/apache2/apache2.conf,

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
RewriteLog /var/log/apache2/rewrite_log
RewriteEngine On
RewriteRule ^/index.html /index.php

I don't get any errors on apache2 start, but the rule doesn't work.
I've tried a bunch of other rules too, and I can't get any simple 
RewriteRules to do anything.  It created the rewrite_log log file, but 
it is empty, so I do not even know where to look to track down the problem.

Any suggestions?

Thanks,
Ken



---------------------------------------------------------------------
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


Re: [users@httpd] Can't get mod_rewrite to do anything

Posted by Ken Schutte <ks...@csail.mit.edu>.
Vincent Bray wrote:
> The debian apache layout usually includes a default virtual host in a
> directory called sites-enabled. If you 've got one of those, your
> rewrite rules in the main server context will have no effect. There
> are two ways around this, either move the rules in to the default
> vhost, or add RewriteEngine On and RewriteOptions Inherit to that
> vhost.
> 

That was it - I put it in the default vhost file and it's working now. 
Thanks!

Ken

---------------------------------------------------------------------
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


Re: [users@httpd] Can't get mod_rewrite to do anything

Posted by Vincent Bray <no...@gmail.com>.
On 8/1/06, Ken Schutte <ks...@csail.mit.edu> wrote:
> Hi,
>
> I'm using apache2 on Debian, and have the following in
> /etc/apache2/apache2.conf,
>
> LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
> RewriteLog /var/log/apache2/rewrite_log
> RewriteEngine On
> RewriteRule ^/index.html /index.php
>
> I don't get any errors on apache2 start, but the rule doesn't work.
> I've tried a bunch of other rules too, and I can't get any simple
> RewriteRules to do anything.  It created the rewrite_log log file, but
> it is empty, so I do not even know where to look to track down the problem.

The debian apache layout usually includes a default virtual host in a
directory called sites-enabled. If you 've got one of those, your
rewrite rules in the main server context will have no effect. There
are two ways around this, either move the rules in to the default
vhost, or add RewriteEngine On and RewriteOptions Inherit to that
vhost.

-- 
noodl

---------------------------------------------------------------------
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