1

I want to redirect except this folder css or js or image and is not working.

I have tried below code-

RewriteCond %{REMOTE_HOST} !^(css|js|image)
RewriteRule ^([^/]+)/?$ find.php?term=$1&type=test&path=1 [L,QSA]

and

RewriteRule ^([^(css|js|images|/)]+)/?$ find.php?term=$1&type=test&path=1 [L,QSA]

But it is not working.

Thanks in advance for any help.

1 Answer 1

1

You need match against ℅{REQUEST _URI} instead of ℅{REMOTE _HOST} .

RewriteCond %{REQUEST_URI}  !\.(css|js|image)
RewriteRule ^([^/]+)/?$ find.php?term=$1&type=test&path=1 [L,QSA]
Sign up to request clarification or add additional context in comments.

1 Comment

It works! it is not exclude png jpg gif images, I tried like thisRewriteCond %{REQUEST_URI} !\.(css|js|png|jpg|gif)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.