views:

43

answers:

2

i need to much the sentense, if it doesn't contain some words i wrote it like this

^([^news|home|rules|contacts|month_films|archive|ratings])$

but it doesn't work. could you tell me why? thanks

A: 

try this (without []):

 ^(news|home|rules|contacts|month_films|archive|ratings)$
oraz
but that would exactly match "news" for example - I think he wants to match everything *except* "news", etc.
Joscha
+1  A: 

In this case, put a ! in front of the regular expression and use a RewriteCond:

 RewriteCond %{REQUEST_URI} !(news|home|rules|contacts|month_films|archive|ratings)
 RewriteRule <whatever it is you want to do>
Kinopiko
@Kinopiko it is interesting! but i don't know about RewriteCond:(what is {REQUEST_URI}?
Syom
Please refer to the Apache documentation.
Kinopiko