Simon
Simon

Reputation: 23141

.htaccess: RewriteRule problem

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

Upvotes: 0

Views: 97

Answers (2)

user181548
user181548

Reputation:

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>

Upvotes: 1

Oleg Razgulyaev
Oleg Razgulyaev

Reputation: 5935

try this (without []):

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

Upvotes: 0

Related Questions