SSL Sub directory redirect to HTTPS

DaveL

Habitué
Joined
Feb 4, 2007
Messages
1,431

TLChris

Administrator
Joined
Jan 2, 2020
Messages
295
Are you using htaccess? NGINX?

What does your htaccess look like? Are you using CloudFlare or any other DNS providers?
 

DaveL

Habitué
Joined
Feb 4, 2007
Messages
1,431
Are you using htaccess? NGINX?

What does your htaccess look like? Are you using CloudFlare or any other DNS providers?

Thanks for the reply,
I'm using htaccess, no other DNS providers.

This is the htacess which is in my main directory

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]


# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
 

TLChris

Administrator
Joined
Jan 2, 2020
Messages
295
Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R=301,L]

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R=301,L]

Jake at XF shared that years ago, and it's helped me whenever I would use htaccess.
 

DaveL

Habitué
Joined
Feb 4, 2007
Messages
1,431
Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R=301,L]

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R=301,L]

Jake at XF shared that years ago, and it's helped me whenever I would use htaccess.
Thanks for that, no joy i'm afraid. Will keep digging!
 
Top