Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite issue

         

enotalone

3:08 pm on May 27, 2006 (gmt 0)

10+ Year Member



RewriteRule ^([0-9]*)-([0-9]*).html /myscript.php?var=$1&var2=$2 [NC,L]

I have been the code above for few years now, it works fine but when a url such as 2-1.html__ is requested it still works instead of producing 404.

The question is how could i modify it so if there is anything else after .html it does not get executed?

it is a little strange to me as i do not have a wildcard or anythign after .html and why it still executes a url like 2-1.html__ i have no clue.

Thank you.

jdMorgan

3:33 pm on May 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You *do* have a wildcard, because the pattern is not end-anchored; Add a "$" after ".html" to end-anchor the pattern.

Jim

[edited by: jdMorgan at 3:42 pm (utc) on May 27, 2006]

enotalone

3:41 pm on May 27, 2006 (gmt 0)

10+ Year Member



Thanks Morgan! Will add it now.