Jump to content

[SOLVED] Strange url issue for links


Recommended Posts

I've just updated my site to Prestashop 1.4.6.2 and set up a new theme.

 

I'm having a strange issue with URL's on my live site: www.equivetaminalcare.com

 

From the homepage, if you hover over the footer links under "Information" the URL for "About Us" shows as "http://www.equivetanimalcare.com/cms.php?id_cms=29"

 

However, when I click one of the banners (tmbanners) (you'll need to turn off Adblocking to see it), i.e. the "Speed" banner above on the left and THEN hover over the same "About Us" link - the URL shows differently:

 

"http://www.equivetanimalcare.com/speed/cms.php?id_cms=29"

 

As you can see, it seems to have inserted the ""/speed" part which is the category of the product that the banner links to.

 

It seems that when I click on the banners, they somehow insert the category into the url for the footer links!

 

I can't figure out why/how this is happening. I've tried re-generating the .htaccess file, disabling multiviews, and the footer links contain only:

 

<li><a href="cms.php?id_cms=29">{l s='About Us' mod='tmfooterlinks'}</a></li>

 

Any help would be very much appreciated in finding out why this is happening because it's generating 404 errors and before that "Category not found" errors. I've obviously changed something that means I'm now getting the 404 errors instead of the Category not found but I'm not sure what's causing this.

 

Also, I've got:

 

 

<li><a href="{$link->getPageLink('cms.php?id_cms=29')}"{if {$smarty.server.REQUEST_URI} == '/content/29-about-us'} class="active"{/if}>{l s='about us' mod='tmheaderlinks'}</a></li>

 

In my tmheaderlinks.tpl - could

{$smarty.server.REQUEST_URI}

have anything to do with this?

 

Thanks

 

EDIT:

 

Even stranger is that when I check the page source, the link comes up as:

 

<a href="cms.php?id_cms=29">About Us</a>

 

Which means it's probably javascript causing some kind of error because the shop URL must be prefixed to the link on hover? What could be causing this and how do I correct it for the footer links?

Link to comment
Share on other sites

{$smarty.server.REQUEST_URI} show the URL address of your current page.

 

I think there are some problems with your .htaccess file.

 

Try to turn off Friendly URLS and check if something is better, then try to turn it on again. In addition, maybe there are some problems with your theme too - it is hard to say.

Link to comment
Share on other sites

{$smarty.server.REQUEST_URI} show the URL address of your current page.

 

I think there are some problems with your .htaccess file.

 

Try to turn off Friendly URLS and check if something is better, then try to turn it on again. In addition, maybe there are some problems with your theme too - it is hard to say.

 

Thanks for your reply.

 

When I turn off Friendly URL, the problem seems to not happen anymore. Does the Friendly URL use Javascript at all?

 

I've noticed that when the problem is happening, the source code has:

 

<li><a href="cms.php?id_cms=29">About Us</a></li>

 

But when I hover over this link in the browser, the URL is: http://www.equivetanimalcare.com/content/cms.php?id_cms=29

 

The only way I know that this can be done is with Javascript. What could be causing this? Is this something Prestashop does?

 

I'm using the "Tmbanner(s)" that came with my theme and I've looked through the tpl and php files to see what could be causing this but can't figure it out. I can't even find out where these Tmbanners come from as they're all modules in the back office. I've tried re-setting them but it makes no difference.

 

As a last resort, I might have to remove all the Tmbanner modules and re-create them in the theme tpl files but I'd prefer not to have to do that!

 

So is this a Javascript issue or error and how can I fix it?

 

I can give any more info if needed.

 

Many Thanks

Link to comment
Share on other sites

Well it looks like I found the solution in another thread. Any relative links need to have forward slashes in front: i.e. in my tpl file for tmfooterlinks it had:

 

<li><a href="cms.php?id_cms=6">{l s='Privacy Policy' mod='tmfooterlinks'}</a></li>

 

It just needs a "/" (forward slash in front of the beginning of the url i.e.:

 

<li><a href="/cms.php?id_cms=6">{l s='Privacy Policy' mod='tmfooterlinks'}</a></li>

 

Hope that helps someone, and credit for this goes to the OP of this thread:

 

http://www.prestashop.com/forums/topic/143069-cms-pages-friendly-url-breaking-links/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...