Skip to main content

Canonical URL on MAMP generates incorrectly

More
11 years 3 weeks ago #213731 by helenbn
-- url of the page with the problem -- : http://localhost:8888/mysite/
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.4.10
-- Browser(s) name and version -- : FireFox 40.0.3

Hi,

The Canonical URL generates incorrectly when on MAMP.

My site begins http://localhost:8888/mysite/...

but the Canonical URL generates http://localhost/mysite:8888/...

I need help with this.
Thanks,
Helen

Pretty Good Designs | prettygooddesigns.com | Hey, that's pretty good!

Please Log in or Create an account to join the conversation.

More
11 years 3 weeks ago #213737 by nicolas
Hi,

Thank you for your feedback.
Change the code:
Code:
if(!empty($parsedCurrent['port']) && $parsedCurrent['port']!= 80){ $endUrl = ':'.$parsedCurrent['port'].$endUrl; } if(isset($parsedCurrent['path']) && !preg_match('#^/?'.$parsedCurrent['path'].'#',$endUrl)) $parsedCurrent['path'] = preg_replace('#/$#','',$parsedCurrent['path']); else $parsedCurrent['path'] = ''; $cleanUrl = $parsedCurrent['scheme'].'://'.$parsedCurrent['host'].$parsedCurrent['path'].$endUrl; return $cleanUrl;
to:
Code:
$port = ''; if(!empty($parsedCurrent['port']) && $parsedCurrent['port']!= 80){ $port = ':'.$parsedCurrent['port']; } if(isset($parsedCurrent['path']) && !preg_match('#^/?'.$parsedCurrent['path'].'#',$endUrl)) $parsedCurrent['path'] = preg_replace('#/$#','',$parsedCurrent['path']); else $parsedCurrent['path'] = ''; $cleanUrl = $parsedCurrent['scheme'].'://'.$parsedCurrent['host'].$port.$parsedCurrent['path'].$endUrl; return $cleanUrl;
in the file administrator/components/com_hikashop/helpers/helper.php and that should fix the problem.
The following user(s) said Thank You: helenbn

Please Log in or Create an account to join the conversation.

More
11 years 3 weeks ago #213801 by helenbn
Thank you for the quick fix! This works perfectly!!

Pretty Good Designs | prettygooddesigns.com | Hey, that's pretty good!

Please Log in or Create an account to join the conversation.

Time to create page: 0.161 seconds
Powered by Kunena Forum