0

I currently have this apache config code for a drupal installation (excerpt).

RewriteCond %{REMOTE_ADDR} !^192\.51\.153\.4$
RewriteCond %{QUERY_STRING} q=(admin|user/(password)) [NC]
RewriteRule . . [F]

The purpose is to prevent access to the admin section unless you have the specified ip.

I would now like to add some logic to the condition: If you are trying to reach this url: /admin/build/panels/* then that should be ok, from all ip's. Is it possible?

thanks!

1 Answer 1

1

Just add one more RewriteCond to your rule

RewriteCond %{REQUEST_URI} !^/admin/build/panels/ [NC]

This would prevent your forbidden [F] rule to fire for a given URL path and its sub-directories.

Sign up to request clarification or add additional context in comments.

Comments

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.