Page 1 of 1

URLs triggering 404 when ssl is enabled

Posted: Tue May 15, 2018 4:04 pm
by smohit1515
I am having an issue with the website that I developed when ssl is enabled on the website.
Sometimes when you go to a category or in a product details page, it throws the "Page you requested cannot be found" error. Just randomly.
The error gets triggered when you click on the additional images as well.
This is the link to the dev site that I am testing: https://www.sd-dev.sofasdirect.com.au/. Categories are under Products>>HOME DECOR | ONLINE SHOP heading
To trigger the error you will have to go to a category page or click on additional image.

This issue only happens when ssl is enabled. I have been trying to find the issue for the past few days but still no luck.
Just wondering if anyone could help.

Re: URLs triggering 404 when ssl is enabled

Posted: Wed May 16, 2018 6:02 am
by yodapt
Have you checked for duplicate entries on SEO?

Re: URLs triggering 404 when ssl is enabled

Posted: Wed May 16, 2018 9:18 am
by smohit1515
I haven't checked it but will check that out. Do you think having duplicate entries do cause issues like that?
I disabled the seo urls and tried loading the website without it. And the error still shows up even without using seo urls on random category or product pages.

Re: URLs triggering 404 when ssl is enabled

Posted: Thu May 17, 2018 1:42 am
by MrPhil
I see that on an SSL page such as https://www.sd-dev.sofasdirect.com.au/ a link such as http://www.sofasdirect.com.au/upholstery is non-SSL, and might be causing you problems. Are these hard coded "Read More" entries? If nothing else, you are not redirecting http: requests to https: via .htaccess (which should not be used for internal links... correct the links themselves).

Re: URLs triggering 404 when ssl is enabled

Posted: Thu May 17, 2018 8:43 am
by smohit1515
Yes, the "Read More" links are hard coded.
The 404 error comes up only when you click on categories or sometimes on random products or when you try and view the additional images in the product details section. With the images in the product details section when you click to view the additional image, it won't load at all, sometimes. At first I thought there might be something wrong with the seo urls, so I disabled it and tried again. But still it comes with the same issue.
This is the force https code that I have used in htaccess.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.sd-dev.sofasdirect.com.au [L,R=301]

I have been trying to fix this issue for more than a week and still couldn't figure out what exactly is going on.

Re: URLs triggering 404 when ssl is enabled

Posted: Thu May 17, 2018 10:03 am
by yodapt
After several dozen refreshes, the behaviour seems to be connected with resource limits. Often when you get a 404 on an asset or link you get a few more of them in a row in the same request, which seems to indicate the server is too busy and rejects the request? Just an idea, might be worth talking withe the hosting company about it.

Re: URLs triggering 404 when ssl is enabled

Posted: Thu May 17, 2018 10:43 pm
by MrPhil
smohit1515 wrote:
Thu May 17, 2018 8:43 am
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.sd-dev.sofasdirect.com.au [L,R=301]
Uh, that will take you back to the root (store entrance), rather than simply moving you from non-SSL (http) to SSL (https). You need to change it to

Code: Select all

RewriteEngine On
RewriteCond  %{HTTPS}  off
RewriteRule  ^(.*)$  https://www.sd-dev.sofasdirect.com.au/$1 [R=301,L]