View Single Post
Old 10-23-2023, 05:17 AM  
JustBiz
Confirmed User
 
JustBiz's Avatar
 
Industry Role:
Join Date: Jun 2019
Posts: 2,113
Quote:
Originally Posted by mopek1 View Post
Thanks everyone for the replies. It's appreciated.
Two questions:

For this code: "RewriteCond %{HTTPS} off" I've seen a variation where it says "on" instead off "off" at the end. What does that even mean and which is correct?

Also, does my domain name fit anywhere into any of the htaccess codes in the examples above? Or do I copy and paste the code as is.

Like I said, I've seen many variations and just want to make sure it's right.
1 - RewriteCond %{HTTPS} off => if requested url is http, do what follows
RewriteCond %{HTTPS} on => if requested url is https, do what follows

2 - You don't need enter your domain name in any of the htaccess entries in this thread. The ones I posted should 301 the following to https://www.yourdomain.[tld]:

http://yourdomain.[tld]
http://www.yourdomain.[tld]
www.yourdomain.[tld]
https://yourdomain.[tld]

If anything you add to .htaccess causes an issue, removing what you added should fix it in seconds.

As plsureking put, the htaccess should have the RewriteEngine On line first.
JustBiz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote