You are here:  » Multiple Install baseHREF issues


Multiple Install baseHREF issues

Submitted by Antony on Mon, 2020-09-21 10:44 in

Hi David Hope you're good,

I have a multiple install PT for various countries and all install being served by the same HTML folder, each install has its own DB.

The strange thing that I really can't work out is that although the first directory seems to generate internal navigation links fine ie. https://example.com/ca/ (For Canada) all internal links point to CA install but as soon as click on any links/I reach a third or deeper directory https://example.com/ca/you-are-here, all links (Menu, footer, Search...) now point out to the UK directory

In each install has the correct baseHREF in place ie. for Canada $config_baseHREF = "/ca/";

And the internal link are also correct in my opinion using

<?php
 
print $config_baseHREF
?>
therefore should return https://example.com/ca/.

See for yourself visiting {link saved} (All good here) then click on any links and although it seems to be okay all link now point to a different install (uk)???

Please let me know of your thoughts or let me know if you have any questions,

Thanks,

Ant

Submitted by support on Mon, 2020-09-21 11:30

Hello Ant,

Viewing the source of a product page, I notice that the <head> contains (examplified)...

  <base href="https://example.com/uk/">

So that may be hard-coded and if removed might be all you need to do, although if required (and should be pointing to $config_baseHREF) then you might want to use something like:

  <base href="https://example.com<?php print $config_baseHREF?>">

That might be all it is...

Cheers,
David.
--
PriceTapestry.com

Submitted by Antony on Mon, 2020-09-21 12:04

Hi David, thanks for the quick response,

Gone though your suggestion and removed it but unfortunately it did not correct the issue.

Any other thoughts by any chance?

Thanks,

Ant

Submitted by Antony on Mon, 2020-09-21 12:46

Hi David,

So sorry it's all fixed now, each install has it own .htaccess where it detailed RewriteBase /uk/ now corrected to /ca/, /eu/, /au/ ... and it all works like a dream.

With the above now I have another questions if I may. Is it okay to have multiple .htaccess for one domain?

At present I have 1 .htaccess file in my root directory where the home page reside:

{code saved}

And another .htaccess file in each other install directory:

{code saved}

Is this a correct practice or should i merge all this?

Thanks again for your great support David.

Ant

Submitted by support on Mon, 2020-09-21 12:53

Hello Ant,

That's absolutely fine as-is, .htaccess is intended to be per-directory no need to merge anything at all...

Cheers,
David.
--
PriceTapestry.com

Submitted by Antony on Mon, 2020-09-21 12:59

Thanks Man!