Thursday, February 16, 2006

"users" : Reserved Word in Apache mod_rewrite ?

Quick pop quiz : does anyone know if the word "users" is some kind of reserved word in Apache 2.0.55 mod_rewrite on Windows?

The reason I ask is that I have a rewrite rule like this:

RewriteRule ^members/(.+)$ /users.cfm?sParams=$1 [R,L]

- to allow me to rewrite a URL of the form (site)/users/(screenname) into the form (site)/users.cfm?sParams=(screenname)

The L means this is the LAST rule that should be processed, if it matches
The R stands for REDIRECT and means that the rewritten URL appears in the browser location bar - handy for debugging on dev.

The issue I'm having is that if I do this, it doesn't work - it gives me a 404 error.
However, if I change the URL stub to something else - anything else - e.g.

RewriteRule ^donkeys/(.+)$ /users.cfm?sParams=$1 [R,L]

then it works fine.

I don't have any file or directory called users in that directory.
The word "users" doesn't appear in any other Apache directives.

In the face an extremely tight dev budget, I've had to just admit defeat and use a url stub of "members" instead, but I'd be interested to hear if anyone knows what might be going on here.

1 comment:

Shehi said...

Guess it is. I am having the same problem with "register" :(