How do I make the following url forbidden in apache;
main/index.php?site=ing
I have tried the following;
RewriteRule ^main/index.php?site=ing - [F]
but with no luck...
How do I make the following url forbidden in apache;
main/index.php?site=ing
I have tried the following;
RewriteRule ^main/index.php?site=ing - [F]
but with no luck...
You cannot match a query string in the RewriteRule, you have to do
RewriteCond %{QUERY_STRING} site=ing #Adjust the regexps with anchors
RewriteRule ^main/index.php - [F]
Another non apache solution, would be to do this in the index.php file.
Add something like this to the top of the page.
if(isset($_GET['site']) && $_GET['site'] == 'ing'){
header('HTTP/1.1 403 Forbidden');
exit();
}
This should do it:
RewriteCond %{QUERY_STRING} (^|&)site=ing(&|$)
RewriteRule ^main/index\.php$ - [F]