Solved

mod_rewrite: Send users from specific IP a 404 error

Posted on 2007-03-29
3
227 Views
Last Modified: 2011-09-20
How can I use mod_rewrite to send users from a specific IP address a 404 error when they try to access my site?
0
Comment
Question by:rbichon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
JamesCssl earned 250 total points
ID: 18821352
RewriteCond %{REMOTE_ADDR} ^127.0.0.1$
RewriteRule ^.* - [F]



This would send 403 Forbidden

RewriteCond %{REMOTE_ADDR} ^127.0.0.1$
RewriteRule ^.* - [G]

and this would send 410 Gone.  The only way I can think of to make a 404 error is to proxy to a page that produces a 404 error.
0
 
LVL 1

Author Comment

by:rbichon
ID: 18822553
I'll just use the 403 Forbidden one.then. It worked perfectly. Is there a way to give a 500 Internal server error instead so that they think our site is down?
0
 
LVL 11

Expert Comment

by:JamesCssl
ID: 18823394
As with trying to generate a 404 error, generating a 500 error while the server is working perfectly would be quite difficult.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question