views:

42

answers:

1

Hi, as i describe already above if i call e.g. /berlin it properly routes, but if i try /berlin-blabla-50-prozent-rabatt.html it also takes the first rule,i'm not sure how to negate the regex telling if it has "-" or something like that take the second. I also got a problem, if i put a trailing / it also breaks, do i have to add a third rule to cover the trailing /? Every help appreciated!

RewriteRule ^(.*)$ /dev/index.html?city=$1 [NC,R]
RewriteRule ^(.*)-(.*)-50-prozent-rabatt.html$ /dev/index.html?city=$1&deal=$2 [NC,L,R]

Thanks in advance!

+1  A: 

The first rule catches everyting, so it will never go on to any other rules.

Switch places on the rules. A rule that catches everything always has to be last.

Guffa
kritop
An "internal server errror" is a pretty useless error message. You have to get the actual error message to get any clue to the reason. My first guess would be that the page can't handle the value that you put in the city query string.
Guffa
i know thats why i'm also a bit clueless, but the rules each alone work, only together it fails.
kritop