Question

I am experiencing a weird issue on my PrestaShop website.

When I am opening an URL without WWW on it, it redirects to the WWW page, but displays 404 page.

for example, when I am trying to access http://mydomain.com/home/contact-us it takes me to http://www.mydomain.com/home/contact-us?controller=404. It should not add ?controller=404 to the end of the url. Why it's doing this and how to fix this issue?

Was it helpful?

Solution

You need to manually edit the .htaccess file of your Prestashop website. You can redirect all non-www urls to add www using this code.

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

Place the code on top of your .htaccess file or within the condition block for checking mod_rewrite

OTHER TIPS

you can set your url under "Preferences > SEO & URLs". you have to change the options "Shop domain" and "SSL domain" there you can set with or without "WWW".

This is most probably cased by not-generated .htaccess file. Go to BackOffice -> Preferences -> SEO & URLs and click [Save]. This will regenerate your .htaccess file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top