Jump to content

search.php and category.php not working with FriendlyURL


Recommended Posts

Hello all,

 

I've encountered several problems after I turned on friendly-url on my site. I generated the .htaccess file as it should be. The first issue is:

 

Search.php is not working at all. I can't do any searches on the search bar. Tags block is not working either. When I click on a tag or I type something in the search bar and hit enter, the site redirects itself to the homepage.

 

The second issue is:

 

I get "Missing category ID" error when I click the category links in the catogories block. But if I edit and change the "Friendly URL" property of the specific category, somehow it works. (for example, the category name is "Sensors" and friendly-url property is "sensors", I change it to "sensorsss" and it works.) But I don't want it to remain "sensorsss", it's silly!

 

My prestashop version is 1.4.2.5 and I use Prestashop Alternative theme and my site is multilingual. When friendly-url is on, my site url becomes http://www.myshop.com/en/ or .../tr/..

 

I think the problem is in the .htaccess file. How can I fix this?

 

This is my current .htaccess file

 

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

<IfModule mod_rewrite.c>
# URL rewriting module activation
RewriteEngine on
# URL rewriting rules
RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [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 ^([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 ^[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-]* /category.php?id_category=$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?id_cms=$1 [QSA,L]
RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [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/404-error$ /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/forgot-your-password$ /password.php?isolang=en [QSA,L]
RewriteRule ^en/specials$ /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/stores$ /stores.php?isolang=en [QSA,L]
RewriteRule ^en/suppliers$ /supplier.php?isolang=en [QSA,L]
RewriteRule ^en$ /en/ [QSA,L]
RewriteRule ^en/([^?&]*)$ /$1?isolang=en [QSA,L]
RewriteRule ^tr/404-error$ /404.php?isolang=tr [QSA,L]
RewriteRule ^tr/address$ /address.php?isolang=tr [QSA,L]
RewriteRule ^tr/addresses$ /addresses.php?isolang=tr [QSA,L]
RewriteRule ^tr/authentication$ /authentication.php?isolang=tr [QSA,L]
RewriteRule ^tr/best-sales$ /best-sales.php?isolang=tr [QSA,L]
RewriteRule ^tr/cart$ /cart.php?isolang=tr [QSA,L]
RewriteRule ^tr/contact-us$ /contact-form.php?isolang=tr [QSA,L]
RewriteRule ^tr/discount$ /discount.php?isolang=tr [QSA,L]
RewriteRule ^tr/guest-tracking$ /guest-tracking.php?isolang=tr [QSA,L]
RewriteRule ^tr/order-history$ /history.php?isolang=tr [QSA,L]
RewriteRule ^tr/identity$ /identity.php?isolang=tr [QSA,L]
RewriteRule ^tr/manufacturers$ /manufacturer.php?isolang=tr [QSA,L]
RewriteRule ^tr/my-account$ /my-account.php?isolang=tr [QSA,L]
RewriteRule ^tr/new-products$ /new-products.php?isolang=tr [QSA,L]
RewriteRule ^tr/order$ /order.php?isolang=tr [QSA,L]
RewriteRule ^tr/order-follow$ /order-follow.php?isolang=tr [QSA,L]
RewriteRule ^tr/quick-order$ /order-opc.php?isolang=tr [QSA,L]
RewriteRule ^tr/order-slip$ /order-slip.php?isolang=tr [QSA,L]
RewriteRule ^tr/forgot-your-password$ /password.php?isolang=tr [QSA,L]
RewriteRule ^tr/specials$ /prices-drop.php?isolang=tr [QSA,L]
RewriteRule ^tr/search$ /search.php?isolang=tr [QSA,L]
RewriteRule ^tr/sitemap$ /sitemap.php?isolang=tr [QSA,L]
RewriteRule ^tr/stores$ /stores.php?isolang=tr [QSA,L]
RewriteRule ^tr/suppliers$ /supplier.php?isolang=tr [QSA,L]
RewriteRule ^tr$ /tr/ [QSA,L]
RewriteRule ^tr/([^?&]*)$ /$1?isolang=tr [QSA,L]
</IfModule>
# Catch 404 errors
ErrorDocument 404 /404.php

Link to comment
Share on other sites

×
×
  • Create New...