code_junkie

Block user access to internals of a site using HTTP_REFERER

Nov 10th, 2011
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. RewriteEngine on # Options +FollowSymlinksRewriteCond %{HTTP_REFERER} !^http://mywebaddress(.cl)?/.* [NC]RewriteRule (servlet1|servlet2)/.+?.+ - [F]
  2.  
  3. RewriteCond %{HTTP_REFERER} !^http://(www.)?example.(com|org) [NC]RewriteCond %{QUERY_STRING} ^.+$RewriteRule ^(script1|script2).cgi - [F]
  4.  
  5. RewriteCond %{HTTP_REFERER} !^http://(www.)?example.(com|org) [NC]RewriteCond %{QUERY_STRING} ^.+$ [OR]RewriteCond %{REQUEST_METHOD} ^POST$ [OR]RewriteCond %{PATH_INFO} ^.+$RewriteRule ^(script1|script2).cgi - [F]
  6.  
  7. RewriteCond %{HTTP_REFERER} !^http://mywebaddress(.cl)?/.* [NC]RewriteCond %{QUERY_STRING} ^.+$ [OR]RewriteCond %{REQUEST_METHOD} ^POST$ [OR]RewriteCond %{PATH_INFO} ^.+$RewriteRule (servlet1|servlet2)b - [F]
Add Comment
Please, Sign In to add comment