Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active November 2, 2018 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedir/b1ad5c052cf415d259ad90f64bb39886 to your computer and use it in GitHub Desktop.
Save fedir/b1ad5c052cf415d259ad90f64bb39886 to your computer and use it in GitHub Desktop.
.htaccess, Private domain access from selected IPs only, with a redirect to fallback domain
RewriteCond %{REMOTE_ADDR} !^XX\.XX\.XX\.XX$
RewriteCond %{REMOTE_ADDR} !^XX\.XX\.XX\.XX$
RewriteCond %{HTTP_HOST} ^(private-domain) [NC]
RewriteRule ^(.*)$ http://fallback-domain$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment