MicroGuy Computer Services Greenwood SC

    • Home
    • Micro’s Forum
    • Blog
    • Domain Sales
    • Contact
      • Privacy Statement

Adventures with Mod Rewrite

MicroGuy | October 15, 2009

Beer Boy!Yesterday, I was desperately seeking ways to waste loads of time when along comes Mod Rewrite. :)

I’m a reluctant user of Statpress Reloaded (due to buggy database bloat) but do enjoy examining site visitor data during uncontrolled bouts of time wasting. Occasionally I will see unwanted guests browsing my archive of random musings. This is a problem for which I have found a cure. It’s called Mod Rewite.

Let’s say you see someone from 10.10.10.69 reading your private thoughts. Let’s say you don’t like repeating 10′s in IP addresses and let’s also say you’re an IP snob. If you’re running Apache, do this:

1. Modify or create an .HTACCESS file and place it in the root folder.

2. Add something like this to the file:

RewriteEngine On

RewriteBase /

# Redirect specific IP address
RewriteCond %{REMOTE_ADDR} ^10\.10\.10\.69 [OR]

# Redirect Class C subnet
RewriteCond %{REMOTE_ADDR} ^10\.10\.10 [OR]

# Redirect Class B subnet
RewriteCond %{REMOTE_ADDR} ^10\.10

RewriteCond %{REQUEST_FILENAME} !-f

# Name of file to redirect
RewriteRule !down.htm$ down.htm [R=307,L]

Now when pesky visitors return from those ranges, they will be directed to the specified HTML page.

Click here to see my redirect!

Categories
Uncategorized
Comments rss
Comments rss
Trackback
Trackback

« Top 5 TLD Failures New Colette Performance »

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Archives

Pages

  • Home
  • Blog
  • Domain Sales
  • Contact
rss Comments rss valid xhtml 1.1 Use OpenDNS