Help fix a jam

Topics: User Forum
Oct 9, 2006 at 3:39 PM
I can't quite figure out how to resolve this issue I got myself into.

I started with this

RewriteRule ^/directory/(.+) /page.asp?id='$1'

which works great but I need a way to keep that working but if

/directory/aspecificfile.asp is asked for I need it to forward to a different page.

My original rule keeps forwarding it to page.asp?id='aspecificfile.asp'

I can't figure out how to get conditionals to work.

Oct 9, 2006 at 5:43 PM

Your filter rule is way to general. It is going to catch just about anything that comes it's way. If id is a numeric do something like ^/directory/(\d+)$ and that will catch any number. If its a word change the \d to \w. The $ forces an end of line match so anything that ended with .asp would not match since neither \d or \w would match the .asp.

Hope that helps some.