htaccess mod_rewrite for Opencart search page URLs

旧街凉风 提交于 2019-12-11 04:54:39

问题


I'm having some difficulty creating an htaccess mod_rewrite rule which would take the following URL:

http://www.mydomain.com/index.php?route=product/search&filter_name=SEARCH%20CRITERIA

and make it something more along the lines of:

http://www.mydomain.com/search/SEARCH-CRITERIA

or even

http://www.mydomain.com/search?filter_name=SEARCH%20CRITERIA

Everything I've tried seems to break the SEO-friendly URLs that are auto-generated by the Opencart framework. How can this be done?


回答1:


In Your .htaccess file place the rules directly behind the lines used to rewrite sitemap.xml and googlebase.xml and before the last general rule.

The rule could look like:

RewriteRule ^search\/(.*)$ index.php?route=product/search&filter_name=$1

- did not test it, it is just a guess.

Also showing us what have You tried would be highly appreciated.



来源:https://stackoverflow.com/questions/13780840/htaccess-mod-rewrite-for-opencart-search-page-urls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!