Forum
www. to non-www. redirect not working for Perch Shop Products
Hi
We have a www. to non-www. redirect setup in .htaccess which works great with normal pages.
However for Shop Product URLs if you try to go to the www. version we get a 404 not found error (go to the non-www. URL and it works)
So...
https://domain.com/product/{slug} = works
https://www.domain.com/product/{slug} = 404 error
In Shop Settings the Live site URL is set to blank and the Product URL is set to /product/{slug}
.
What am I missing to make the www. redirect to the non-www. for Perch Shop Products work?
Many thanks
Perch Runway: 2.8.34, PHP: 5.6.25, MySQL: 5.6.33, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), perch_blog (5.0), perch_forms (1.8.3), perch_shop_orders (1.0.10), perch_shop_products (1.0.10), collection_2 (2.8.34), perch_shop (1.0.10), perch_members (1.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_members', 'perch_shop', );
PERCH_LOGINPATH: /cms
PERCH_PATH: /home/cvia/K5E8866U/htdocs/cms
PERCH_CORE: /home/cvia/K5E8866U/htdocs/cms/core
PERCH_RESFILEPATH: /home/cvia/K5E8866U/htdocs/cms/resources
Image manipulation: GD Imagick
PHP limits: Max upload 128M, Max POST 128M, Memory: 256M, Total max file upload: 128M
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
Resource folder writeable: Yes
HTTP_HOST: cvandinterviewadvisors.co.uk
DOCUMENT_ROOT: /home/cvia/K5E8866U/htdocs/
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
I am going to go out on a limb and say it's probably the .htaccess rewrite that is causing the issue - at a guess, does the matching rule include dashes? It might be a character in the slug that isn't being matched in the rule and so no rewrite occurs.
Just a guess.
A wild guess...
Thanks for the quick response Duncan.
the .htaccess looks like this...
So much for wild guesses.
I'm as stumped as you - I'm not sure why that wouldn't be working...!