[thelist] mod_rewrite regex help

Matt Warden mwarden at gmail.com
Tue Dec 21 12:07:41 CST 2004

On Mon, 20 Dec 2004 21:20:55 -0500, Matt Warden <mwarden at gmail.com> wrote:
> RewriteRule ^(/collab.*)$ $1 [NC,L]
> RewriteRule ^(.*\.(php|htm|html))$ /server.php?q=$1 [NC,L]
> RewriteRule ^([^\.]*)$ /server.php?q=$1 [L]
> But I am still getting 500 errors.

I figured out what the problem was: my RHS of my rewrite rules had a
slash in the beginning, which was triggering an infinite loop (until
apache steps in, using maxredirects). I took out the beginning slash
and all was well.

The rules that are now working, fwiw, are:

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

Thanks for your help.

Matt Warden
Miami University
Oxford, OH

This email proudly and graciously contributes to entropy.

More information about the thelist mailing list