Jump to content

google sitemap html in URL


printerink

Recommended Posts

Hi.., finally I have got the Google Sitemap to work.. hmm.

 

mysite/1_index_sitemap.xml
mysite/1_e_0_sitemap.xml (which is for categories)
mysite/1_en_1_sitemap.xml (which is for products)

 

The {mysite/1_e_0_sitemap.xml (which is for categories)} is fine with NO .html at the end of the URL

The {mysite/1_en_1_sitemap.xml (which is for products)} is NOT as it puts a .html at the end of the URL

 

The actual URL of the product on my site in the browser does not show a .html

For Example mysite/category/1-product as opposed to mysite/category/1-product.html

 

So the all powerful Google robots tell me that it cannot locate mysite/category/1-product.html because it does not exist.

 

I assume it has something to do with friendly URLs.., or not.., I do not know sadly..,

Please how do I resolve this issue anyone?

Thank you.

Link to comment
Share on other sites

Thank you for your reply Nemops.., but I cannot seem to locate the page where I can "remove the .html extension from the seo and urls config page, on products?"

Unless it is if you mean in the "Schema of URLs"

 

i.e. ROUTE TO PRODUCTS - {category:/}{id}-{rewrite}{-:ean13}

 

I do not have any .html extensions on any of the "ROUTE TOs" if you know what I mean.

Link to comment
Share on other sites

My apologies it is the other way round..hmm

 

mysite/1_e_0_sitemap.xml (is for products)

mysite/1_en_1_sitemap.xml (is for categories)

 

Therefore the

{mysite/1_e_0_sitemap.xml (which is for products)} is the ISSUE as it puts a .html at the end of the URL

Link to comment
Share on other sites

hm.

 

Try  inspecting around line 311 of the module's php file

 

$url = $link->getProductLink($product, $product->link_rewrite, htmlspecialchars(strip_tags($product->category)), $product->ean13, (int)$lang['id_lang'], (int)$this->context->shop->id, 0, true);

 

This gets the product url. After this, use die($url) to see what's being generated.

Link to comment
Share on other sites

I just inspected line 311 as you suggested and it is exactly the same i.e.

 

$url = $link->getProductLink($product, $product->link_rewrite, htmlspecialchars(strip_tags($product->category)), $product->ean13, (int)$lang['id_lang'], (int)$this->context->shop->id, 0, true);

 

but I do not know what you mean when you say "use die($url) to see what's being generated"

Link to comment
Share on other sites

Sorry to trouble you again Nemo1..., and thank you so much for your assistance.., so I put the die($url); into the script and then just run the sitemap as you would normally from the back office.., or can you just test this particular variable another or easier way?

Link to comment
Share on other sites

  • 2 weeks later...

To all those Prestashop users out there who are frustrated and struggling with this issue. The version of Classes/Dispatcher.php which was causing the problem was in presta 1.5.4.1 .... I made the recommended changes etc. which were suggested on the forum and also those suggested in forge with no success.

 

Ultimately I removed Classes/Dispatcher.php and installed the Classes/Dispatcher.php from Prestashop version 1.5.5.0 which seems to have solved the problem. What ramification this may have in future I do not know...but so far so good.

 

So for now I will mark this as solved.

Link to comment
Share on other sites

  • 1 year later...

In my case the problem was not the bug in gsitemap module, but in override. The links for products were created with html path even when I reinstalled module, updated classes, etc. Thing is, that in SEO&URL admin tab you set paths which are overriten by Dispatcher override (that was my case. Just set same paths for all items in Dispather.php as you have in SEO&URL admin tab and it'd be ok. Anyway, that did the trick for me and hope it could help you too.

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...