Solved

mod_rewrite: Send users from specific IP a 404 error

Posted on 2007-03-29
3
225 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
  • 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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