Reputation: 35
How to apply NOT EQUAL condition in inside RewriteRule statement. For example, I want to call mypage.php file and pass an argument only when user not typed "test" data as a parameter. Other than "test" data system should call mypage.php by passing the given argument.
RewriteRule ^/?mypage/!(test)$ mypage.php?arg=$1 [L,NC]
Upvotes: 1
Views: 1334
Reputation: 41219
You can use it like this :
RewriteRule ^/?mypage/((?!test).*)$ mypage.php?arg=$1 [L,NC]
((?!test).*) means Any characters zero or more times excluding test .
Upvotes: 3