Post by gamingdynamics » Sun Oct 09, 2016 11:03 pm

Hi there.

If I try to access my website without any https:// or any www. it takes me to a 404 page.
However if I do add a www. or a https:// the website loads correctly/fine.

OpenCart SSL setting is enabled.

All that I have in the .htaccess is:

Code: Select all

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
Could somebody help please?


Posts

Joined
Wed Oct 05, 2016 5:57 pm

Post by IP_CAM » Mon Oct 10, 2016 5:00 am

Quoted lines are not active, but only remove the needed command lines Quotes,
not the titles above, and better remove the routines, not used. It's now set, to change to WWW !
Ernie

Code: Select all

#Force (http host) www to non www (optional)
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#Force (https host) www to non www (optional)
#RewriteCond %{HTTPS} on
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

#Force (http host) non www to www (optional)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Force (https host) non www to www (optional)
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]


My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by gamingdynamics » Wed Oct 12, 2016 2:39 am

I'm confused. I'm a noob! Please explain in simpleton terms! :p

If I use this code:

http://pastebin.com/EuzTar4a

If I use: 'www.gamingdynamics.com' it redirects me to 'https://www.gamingdynamics.com/401.shtml'

If I use 'gamingdynamics.com' it directs me to 'http://www.www.gamingdynamics.com/401.shtml'
^ See the double www.'s


https://gamingdynamics.com/ or https://www.gamingdynamics.com/ - Loads fine.

Please could you rewrite the .htaccess so it works that I don't have to do anything as it's all over my head, thanks.


Posts

Joined
Wed Oct 05, 2016 5:57 pm
Who is online

Users browsing this forum: No registered users and 212 guests