如何在 opencart 中重写我的搜索页面的 URL。当前网址是:
http://IP/opencart/index.php?route=product/search&filter_name=24
但我需要像这样显示它:
http://localhost/opencart/product/search/42
或任何用户友好的 URL 格式。我试过这个:
RewriteEngine On
RewriteBase /opencart
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteBase /opencart
RewriteRule ^search$ index.php?route=product/search [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/search$
RewriteRule ^([^?]*) index.php?route=$1 [L,QSA]