Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laseoservice/c0e708bbb797812691f978a9bef5cbbc to your computer and use it in GitHub Desktop.
Save laseoservice/c0e708bbb797812691f978a9bef5cbbc to your computer and use it in GitHub Desktop.
Implementing both HTTP and HTTPS 301 redirect to new secure a domain in htaccess for optimal SEO
RewriteEngine On
RewriteCond %{HTTP_HOST} ^losangeles-seoservices\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.losangeles-seoservices\.com$
RewriteRule (.*)$ https://www.laseoservice.com/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*)$ https://www.laseoservice.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment