You are here:  » .htaccess redirect non-www/http to www/https

Active Forum Topics


.htaccess redirect non-www/http to www/https

Submitted by crounauer on Wed, 2021-11-03 21:56 in

Hi David,

I'm having some canonical issues in that the current .htaccess redirect doesn't seem to be working. I wonder if you have any thoughts why that might be?

This is my current .htaccess

{code saved}

Thanks

Submitted by support on Thu, 2021-11-04 08:32

Hi,

There's an example here that performs non-https and non-www in a single rewrite which looks like a good approach - I think you want the second version (rather than www to non-www)...

Cheers,
David.
--
PriceTapestry.com

Submitted by crounauer on Thu, 2021-11-04 10:55

Hi David,

Thanks for the link.

The redirect works now for {link saved} and {link saved} and everything coming off the TLD

I have multiple niche installations of PT installed into directories like {link saved} and it seems to be these that aren't coping with the redirects. I assume I need to put something similar into the directories .htaccess?

The .htaccess file for "/coffee-machines/ is standard as per a clean install.

Thanks
Simon

Submitted by support on Thu, 2021-11-04 12:28

Hi Simon,

AFAIK the top level should handle the redirection across the site - the .htaccess in the sub-directory installations do they have the correct RewriteBase e.g.

RewriteBase /coffee-machines/

Cheers,
David.
--
PriceTapestry.com