Go Back   Cloud Computing > Support > Tutorials and Documentation
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 11-24-11, 09:49
BOD Member
 
Join Date: Jun 2011
Posts: 96
Lightbulb Tip for Apache - Block viewing a page or a stream to an IP via RewriteRules

Here is a little trick to block an IP address to access a certain content with rewriting rules Apache. I will take here the example of a flow, I want to block access to an RSS feed for a given IP address

Here are the rules for Htaccess in the related rewrites:

Quote:
RewriteCond % {REMOTE_ADDR} ^192\.0\.10\.79$
RewriteCond % {REQUEST_URI} ^ / feed.php? Type = rss *
RewriteRule .* / Error.html [R, L]
Basically, it's:
Quote:
If the IP address 192.0.10.79 is equal to

AND

If the requested page is / feed.php? Type = rss
I then redirects to the page / error.html
This trick can be handy if someone uses your feed, for example to create a "blog" without respecting the license of your content.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 00:16.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.