使用 htaccess 更清晰的 url
好的,我正在使用 opencart 这是一个开源购物车。我在此处安装了它,问题是,当您单击任何内容(我的意思是任何内容)时,网址会从这里变为
http://royaltyfreesoundbank.com/
最终
http://royaltyfreesoundbank.com/index.php?route=product/category&path=18
的内容正在发生的事情是
/index.php?route=CONTROLLER/VIEW
有道理的,但网址很难看,我想知道 htaccess 中是否有一种方法可以让所有页面失去这个中间部分,并让
http://royaltyfreesoundbank.com/product/category&path=18
任何人都有类似的想法......提前致谢
Ok so i am using opencart which is an open source shopping cart. I installed it here the problem is that when you click on anything and I mean anything the url goes from this
http://royaltyfreesoundbank.com/
to
http://royaltyfreesoundbank.com/index.php?route=product/category&path=18
so ultimately what is happening is that
/index.php?route=CONTROLLER/VIEW
which makes sense but the url is ugly and I was wondering if there was a way in htaccess that i can just make all the pages lose this middle portion and have it something like this
http://royaltyfreesoundbank.com/product/category&path=18
ideas anyone....thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此处:
然后您可以使用以下网址访问它:
http://example.com/category/product/354
但请注意,这是一个相当广泛的规则,将匹配 anyfolder/anyfolder/45以及已知的类别/产品名称,因此,您可能需要对其进行调整以仅限于已知的类别。
Here:
Then you would access it with urls like:
http://example.com/category/product/354
Note, however, that this is a rather broad rule which will match anyfolder/anyfolder/45 as well as known category/product names, so, you may want to tweak it to limit just to known categories.