httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Warden <>
Subject [users@httpd] mod_rewrite regex help
Date Tue, 21 Dec 2004 02:00:56 GMT
Hello list,

I have the following rules in my .htaccess file:

RewriteEngine On
RewriteRule ^/collab.*$ $1 [NC,L]
RewriteRule \.(php|htm|html)$ /server.php?q=$1 [NC,L]
RewriteRule ^[^\.]*$ /server.php?q=$1 [L]

This is what I'm trying to do:
1. Allow any request to the /collab directory to pass through
2. Catch all requests that do not match #1 and have the form *.php
*.htm or *.html and pass them to server.php. An example would be a
request for /foo/bar/page.htm rewritten to
3. Catch all requests that don't have a dot in them and pass them likewise.

#3 was an attempt to match requests for the default page of the root
and other directories. FIrst, I'm sure there is a better way to do
that. ideas?

But, my main question has to do with th is just not working at all. I
tested my regex's and they seem to match correctly, but I am getting
500 errors in the apache logs when I test things. For example:

... "GET /blah HTTP/1.1" 500 - "-" "Mozilla/5.0 (X11; U; Linux i686;
en-US; rv:1.6) Gecko/20040301 Firefox/0.8"


... "GET /blah.htm HTTP/1.1" 500 - "-" "Mozilla/5.0 (X11; U; Linux
i686; en-US; rv:1.6) Gecko/20040301 Firefox/0.8"

Thanks for any help you can offer.

Matt Warden
Miami University
Oxford, OH

This email proudly and graciously contributes to entropy.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message