How to force HTTPS using the .htaccess file – InMotion Hosting

To force all web traffic to use HTTPS insert the following lines of code in the .htaccess file:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]

Note: Be sure to replace with your actual domain name.

Setting up Permanent 301 Redirects – WPBeginner

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ https://www.newsite.COM/$1 [R=301,L]

301 Redirects for .htaccessScott Phillips on Gist

# Redirect HTTP to HTTPS
Options +FollowSymLinks
RewriteEngine on
RedirectMatch 301 ^(.*)$

Redirection – MOZ

  • 301, “Moved Permanently”—recommended for SEO
  • 302, “Found” or “Moved Temporarily”
  • Meta Refresh

301 Redirects – Google Webmaster Tools – Google

301 Redirect Checkers:

Redirecting Subdirectories to the Root Directory via HTAccess – Perishable Press

  • RedirectMatch 301

The Ultimate How-To Guide on 301 Redirects – Internet Marketing Ninjas

Setting Up 301 Redirects for Dynamic URLs – seOverflow

  • This is amazingly helpful for redirecting URLs with question marks (“?”) and equal signs (“=”)
  • Example: Redirecting to

RewriteCond %{QUERY_STRING} ^tag=howdy-duty$
RewriteRule ^blog/$ [R=301,L]

Leave a Comment