Skip to content

Instantly share code, notes, and snippets.

@solepixel
Created May 27, 2022 16:08
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 solepixel/b1e8d3b8cda6d32ee3b1abf136bb11a2 to your computer and use it in GitHub Desktop.
Save solepixel/b1e8d3b8cda6d32ee3b1abf136bb11a2 to your computer and use it in GitHub Desktop.
.htaccess Redirect All URLs from one domain to another
# Redirect Requests to Live Site.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^stagingsite.net$ [NC]
RewriteRule ^(.*)$ https://livesite.com/$1 [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment