View Single Post
Old 10-14-2018, 03:02 PM  
Fenris Wolf
Confirmed User
 
Industry Role:
Join Date: Nov 2005
Posts: 1,021
.htaccess question

I am hoping someone can help with this issue. I need to force www and https on my site and I am using the following code in my .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} !=""
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Everything works fine when typing the domain directly but when linking deep within the site it only redirects to www and not https as well. So typing h ttp://domain redirects to h ttps://www.domain.com but when typing h ttp://domain.com/anything redirects to h ttp://www.domain.com/anything.
__________________
Email: fenris_wolf3000 (a t ) yah00 . c 0 m
Fenris Wolf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote