Debian – How to get url rewrites to work on Apache 2.2 on Debian Lenny

apache-2.2debiandebian-lennyrewrite

I am trying to get mod_rewrite rules to work under apache 2.2 on Debian Lenny. To try to get it to work first I put the rules in /etc/apache2/mods-enabled/rewrite.load:

RewriteEngine On
RewriteRule http-poll/ http://jabberserver:5280/http-poll [P]
RewriteLog "/tmp/rewrite.log"
RewriteLogLevel 3

However I get 404 error when I use a browser to go to http://localhost/http-poll after restarting apache. Error.log has:

[Wed Jun 30 15:22:53 2010] [error] [client 127.0.0.1] File does not exist: /var/www/http-poll

"/tmp/rewrite.log" is empty.

I have enabled modules( including mod_rewrite) (a2enmod rewrite proxy proxy_http)

Best Answer

I notice that in your rewrite rule, the pattern to match ends with a slash, but the URL you accessed didn't. Try removing the slash from http-poll/ in the RewriteRule and see if that makes it work.

Related Topic