You are here:  » $config_baseHREF change causing logo issue


$config_baseHREF change causing logo issue

Submitted by ChrisNBC on Tue, 2013-10-29 16:36 in

Hi David,

Hope all is going well.

I'm nearing the end of the development of the site I've been working on recently but have a slight glitch which I wondered if you may be able to help me resolve.

In summary, the domain for the site has been pointing to an empty folder whilst I completed development. I re pointed the domain to the pt folder last week and I updated the config file from $config_baseHREF = "/pt/"; to $config_baseHREF = "";.

Everything seems to work fine except for the code I have which calls logos from a sub folder in the 'Logo' folder. It worked fine before I made the changes, I think it's something to do with the use of the $config_baseHREF in the code as when I click on the merchant logo, I get the Apache error message below:

"The requested URL /Sites/MySite/pt/pt/product/merchant/3/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request"

In addition, I notice the 'home' link from the product page now links to itself..I'm going to remove the home link anyway and just left it in for convenience but thought it might be relevant to the above.

The code I'm using in prices.php is:

<a href='<?php print $product["merchantHREF"]; ?>'><?php print (file_exists("/logos/network/".$product["merchant"])?"<img alt='".$product["merchant"]."' src='".$config_baseHREF."/logos/network/".str_replace(" ","%20",$product["merchant"])."' />":$product["merchant"]); ?></a>

Wondered if you might be able to suggest a possible solution to the above?
Thanks in advance.
Regards
Chris

Submitted by support on Tue, 2013-10-29 16:41

Hi Chris,

For an installation in the top level folder of a web server, $config_baseHREF should be:

  $config_baseHREF = "/";

With that in place, your code should not be using the leading "/" infront of each instance of the logos/ folder, e.g.

<a href='<?php print $product["merchantHREF"]; ?>'><?php print (file_exists("logos/network/".$product["merchant"])?"<img alt='".$product["merchant"]."' src='".$config_baseHREF."logos/network/".str_replace(" ","%20",$product["merchant"])."' />":$product["merchant"]); ?></a>

That should be all it is!

Cheers,
David.
--
PriceTapestry.com

Submitted by ChrisNBC on Wed, 2013-10-30 10:27

Thanks for your help David, the above fixed it.

Regards
Chris