mod_rewrite During Site Maintenance by IP Address

If you are performing site maintenance, you can redirect all users to a maintenance page while letting yourself through by IP address:

.htaccess

# If user IP is NOT 123.123.123.123, then redirect to maintenance.html
# (Don't forget to escape the dots)
RewriteCond %{REMOTE_ADDR} !123\.123\.123\.123
RewriteRule .* /maintenance.html [L]

About this entry