Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
<LocationMatch "page=test">
Order Allow,Deny
Deny from all
</LocationMatch>

doesn't work! I still can access http://example.com/?page=test

Any ideas?

share|improve this question

1 Answer 1

To the best of my knowledge, the LocationMatch directive does not match query parameters. Your URL is "http://example.com/", and that is what you can match.

You can use mod_rewrite to match the query string; the following is from the mod_rewrite documentation:

Note: Query String

The Pattern will not be matched against the query string. Instead, 
you must use a RewriteCond with the %{QUERY_STRING} variable.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.