Apache Directive

apache-2.2

Order Allow,Deny
Deny from all

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

Any ideas?

Best Answer

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.