Last active
May 15, 2019 01:26
-
-
Save benhuson/6f1b9d192cc1cab31093 to your computer and use it in GitHub Desktop.
.htaccess rules for redirecting if IP address does not match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect other IP addresses | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# Single IP Address | |
RewriteCond %{REMOTE_HOST} !^00.00.00.00 | |
# Multiple IP Addresses | |
RewriteCond %{REMOTE_HOST} !^(00.00.00.00|00.00.00.00) | |
RewriteRule .* http://www.example.com/ [R=301,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or so ensure maintenance page is not redirected in infinite loop: