简体   繁体   中英

URL not appearing correctly in browser address bar

Using Prestashop for an e-commerce website

i have three categories

-----------------------------------------------------------------
|   Categories  |   Products                                    |
-----------------------------------------------------------------
|   Clothes     |   Image 1         Image 2         Image 3     |                                   
|   Mobile      |   Image 4         Image 5         Image 6     |
|   Cars        |   Image 7         Image 8         Image 1     |
-----------------------------------------------------------------

when i HOVER/CLICKED over CATEGORIES the link generated by browser at the bottom of browser window in firefox is like this

www.website.com/Clothes-1
www.website.com/Mobiles-4
www.website.com/Cars-13

i selected Mobile Category , and link in the browser address bar is this

Address Bar (Browser ) www.website.com/Mobiles-4

------------------------------------------------------------------------
|   Categories              |   Products (Mobile)                       |
------------------------------------------------------------------------
|   Clothes                 |   Mobile 1    Mobile 2    Mobile 3        |                                   
|   Mobile (selected)       |   Mobile 4    Mobile 5    Mobile 6        |
|   Cars                    |   Mobile 7    Mobile 8    Mobile 1        |
------------------------------------------------------------------------

Now when HOVER/CLICKED over any of the mobile available in Products it generate following url

www.website.com/Mobiles/Mobile-4-34.html ( Current behaviour )

where as i feel it should generate url like this

www.website.com/Mobiles-4/Mobile-4-34.html <----------- ( Required is Mobile-4 ( ie 4 is id) )

Current behaviour which also creating SEO problems ... i have tried to change settings in preferences but it does nt work at all.. also i feel prestashop framework is rewriting the url ... and i tried to programmatically update the code by prestashop framework is malfunctioning.

If some guideance or help by any fella?

Prestashop standard

The default way Prestashop displays the friendly url is:

Product route: /category/id-product-name.html

Category route: /id-category

The diference between your example and the default PS 1.5 friendly-url behaviour is that in your example the id is not at the end of the product-name.

Solution

Go to Back Office->Preferences->SEO&URLs->Schema of URLs (page section)

In the Route to products field you should have: {category:/}{id}-{rewrite}{-:ean13}.html

If I understand correctly your need you should have: {id}-{category:/}{id}-{rewrite}{-:ean13}.html

Note:

The {id} part of the rewritten URL is mandatory, so you can not get read of it by changing the back-office settings.

The only way you can do that is by making/purchasing a module for that. I recommend Pretty URL .

In Prestashop SEO-friendly URLs are generated by the .htaccess file. Try to open your .htaccess and see how the URL rewriting is handled (you can operate manually on the parameters to fix it).

Alternatively, try to regenerate your .htaccess .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM