Redirect all external traffic to a temp page

/ Published in: Apache
Save to your folder(s)

This code redirects all external traffic (all traffic not belonging to a particular ip) to a temp page. This is useful for performing site maintenance.

Copy this code and paste it in your HTML
  1. Options +FollowSymlinks
  2. RewriteEngine on
  3. RewriteCond %{REMOTE_HOST} !^123\.45\.67\.89
  4. RewriteCond %{REQUEST_URI} !/alternate_page\.html$
  5. RewriteRule \.html$ /alternate_page.html [R=302,L]


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.