Jump to content

SEF URLS work for categories & home but not for products


Recommended Posts

Hi There

I am using Presta 1.4.0.17 and I have tried enabling SEF URLS (i have sorted the htaccess, I am forcing recomplile and removed cache for testing and my shop isnt in a subfolder. The URLS work okay for the categeories but not for my products. I get a 4040 page for every product which seems odd. Is there amn error in the htaccess generator?

I have had to put the site up with normail URLs for the moment so cant show you an example but my category links were working e.g.

http://www.themasterherbalist.co.uk/en/28-Bonsai_Tree_Kits

my products were looking like this though and saying page not found (the presta version)

http://www.themasterherbalist.co.uk/en/Gardens_and_Growing/8001-japanese-black-pine-5020088080010.html

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE
# http://www.prestashop.com - http://www.prestashop.com/forums



# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L]
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2$3.jpg [L]
RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2.jpg [L]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$1 [QSA,L]
RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*) /supplier.php?id_supplier=$1 [QSA,L]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*) /manufacturer.php?id_manufacturer=$1 [QSA,L]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?isolang=$1&id;_cms=$2 [QSA,L]
RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?isolang=$1&id;_cms_category=$2 [QSA,L]
RewriteRule ^([a-z]{2})/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$2&isolang;=$1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$2&isolang;=$1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$2&isolang;=$1 [QSA,L]
RewriteRule ^([a-z]{2})/content/([0-9]+)\-[a-zA-Z0-9-]* /cms.php?isolang=$1&id;_cms=$2 [QSA,L]
RewriteRule ^([a-z]{2})/content/category/([0-9]+)\-[a-zA-Z0-9-]* /cms.php?isolang=$1&id;_cms_category=$2 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)__[a-zA-Z0-9-]* /supplier.php?isolang=$1&id;_supplier=$2 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)_[a-zA-Z0-9-]* /manufacturer.php?isolang=$1&id;_manufacturer=$2 [QSA,L]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html /product.php?id_product=$3&isolang;=$1 [QSA,L]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html /product.php?id_product=$2&isolang;=$1 [QSA,L]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*) /category.php?id_category=$2&isolang;=$1 [QSA,L]
RewriteRule ^en/page-not-found$ /404.php?isolang=en [QSA,L]
RewriteRule ^en/address$ /address.php?isolang=en [QSA,L]
RewriteRule ^en/addresses$ /addresses.php?isolang=en [QSA,L]
RewriteRule ^en/authentication$ /authentication.php?isolang=en [QSA,L]
RewriteRule ^en/best-sales$ /best-sales.php?isolang=en [QSA,L]
RewriteRule ^en/cart$ /cart.php?isolang=en [QSA,L]
RewriteRule ^en/contact-us$ /contact-form.php?isolang=en [QSA,L]
RewriteRule ^en/discount$ /discount.php?isolang=en [QSA,L]
RewriteRule ^en/guest-tracking$ /guest-tracking.php?isolang=en [QSA,L]
RewriteRule ^en/order-history$ /history.php?isolang=en [QSA,L]
RewriteRule ^en/identity$ /identity.php?isolang=en [QSA,L]
RewriteRule ^en/manufacturers$ /manufacturer.php?isolang=en [QSA,L]
RewriteRule ^en/my-account$ /my-account.php?isolang=en [QSA,L]
RewriteRule ^en/new-products$ /new-products.php?isolang=en [QSA,L]
RewriteRule ^en/order$ /order.php?isolang=en [QSA,L]
RewriteRule ^en/order-follow$ /order-follow.php?isolang=en [QSA,L]
RewriteRule ^en/quick-order$ /order-opc.php?isolang=en [QSA,L]
RewriteRule ^en/order-slip$ /order-slip.php?isolang=en [QSA,L]
RewriteRule ^en/password-recovery$ /password.php?isolang=en [QSA,L]
RewriteRule ^en/prices-drop$ /prices-drop.php?isolang=en [QSA,L]
RewriteRule ^en/search$ /search.php?isolang=en [QSA,L]
RewriteRule ^en/sitemap$ /sitemap.php?isolang=en [QSA,L]
RewriteRule ^en/supplier$ /supplier.php?isolang=en [QSA,L]
RewriteRule ^en/([^?&]*) /$1?isolang=en [QSA,L]
RewriteRule ^fr/page-non-trouvee$ /404.php?isolang=fr [QSA,L]
RewriteRule ^fr/adresse$ /address.php?isolang=fr [QSA,L]
RewriteRule ^fr/adresses$ /addresses.php?isolang=fr [QSA,L]
RewriteRule ^fr/autentification$ /authentication.php?isolang=fr [QSA,L]
RewriteRule ^fr/meilleures-ventes$ /best-sales.php?isolang=fr [QSA,L]
RewriteRule ^fr/panier$ /cart.php?isolang=fr [QSA,L]
... it is cropped here...
Link to comment
Share on other sites

  • 2 weeks later...

To provide more details - to check this isnt a language problem I disabled extra languages and regenerated the htaccess files and I still have the same issue, this time without the /en/ or relevant language indicator.

So whilst the category URLS work the product URLs do not for instance -

http://www.themasterherbalist.co.uk/For_The_Home/4109-lavender-room-and-linen-spray-5020088041097.html

just comes up with a Error We're sorry, but the Web address you entered is no longer available

(I have cleared the cache and am on force compile etc)

I really hope someone can give me some help? is it these lines?

RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$1 [QSA,L]
RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]

Link to comment
Share on other sites

If anyone else has problems mine was oslved thankfully by a presta staff member - solution was:

This was due to the rule :
RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]

In the following URL : http://www.***.co.uk/Gardens_and_Growing/7740-gardener-s-friend-intensive-repair-hand-cream-5020088077409.html, the category name contains the '_' character.
This character is not interpreted by your .htaccess rule, so I add it.

RewriteRule ^[a-zA-Z0-9-_]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]

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