To view this, you need to install the Flash Player 7. Please go to here and download it.

htaccess redirecting everyone [block all ip address] except for your (my) own ip

this code will redirect all ips other then the one you set to “another-page.php” via 302 redirect

the only ip allowed will be your, which is 25.35.45.55 in this case


Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^25\.35\.45\.55
RewriteCond %{REQUEST_URI} !/main\.htm$
RewriteRule .* http://www.domain.com/old/main.htm [R=302,L]

redirect only index page and leave everything else as is:


Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$
RewriteCond %{REQUEST_URI} !/index\.htm$
RewriteRule \.(php|s?html?)$ http://subdomain.something.com [R=302,L]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • email
  • LinkedIn
  • MSN Reporter
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz

This entry was posted on Wednesday, May 20th, 2009 at 11:51 pm and is filed under htaccess .

One Response to “htaccess redirecting everyone [block all ip address] except for your (my) own ip”

  1. Jesper says:

    Will it be possible to add severel ips with access to the site, or only one as in this example?

Leave a Reply

Name (required)

Mail (will not be published) (required)

Website

Categories