Skip to content

Instantly share code, notes, and snippets.

@Dan0sz
Last active March 10, 2019 09:00
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 Dan0sz/3f601cd8185112983e7b5c0cbccc9dc2 to your computer and use it in GitHub Desktop.
Save Dan0sz/3f601cd8185112983e7b5c0cbccc9dc2 to your computer and use it in GitHub Desktop.
301 Redirect to new domain including Request URI
RewriteEngine on
# Exception for Google Verification
RewriteCond %{REQUEST_URI} !^/google-verification-file.html
# Exception Let's Encrypt Challenge
RewriteCond %{REQUEST_URI} !^/.well-known/
# 301 Redirect to New Domain incl. Request URI
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
RewriteEngine on
# 301 Redirect to New Domain incl. Request URI
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment