?
Solved

mod_rewrite: Send users from specific IP a 404 error

Posted on 2007-03-29
3
Medium Priority
?
230 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 1000 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

800 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