Hello, all.
I'm working on a project which involves custom RewriteRules that redirect the user to specific CGI pages. The rules look something like this:
CODE
RewriteRule ^story/(.+)$ story/$1.cgi [nc]
However, using that rule throws a 500 error.
I've read and re-read every guide on RewriteRule's I've been able to find, and I can't for the life of me seem to figure out what's going wrong here(if I don't add the
.cgi at the end, it works fine - throwing a 404 because the file doesn't exist).
Does anyone know what I might have done wrong while writing this RewriteRule?
Thanks,
Girasquid
Edit:After tweaking my rule, I have found that this line will work(inside the 'story' directory):
CODE
RewriteRule ^(.+)$ /$1\.cgi [NC,L]
However, that attempts to rewrite to /story.cgi - which is not what I want. I need to rewrite to the local copy. Removing the initial slash, however, throws a 500 error:
CODE
RewriteRule ^(.+)$ $1\.cgi [NC,L]
Taking out the escape on the
. in
.cgi also does not fix anything:
CODE
RewriteRule ^(.+)$ $1.cgi [NC,L]
Edit #2:
After some more testing, it would seem that it's the
. in the .cgi that's breaking things. However, even after I escape the dot(
\.), the problem persists.
This post has been edited by girasquid: 16 Nov, 2007 - 12:26 PM