Opencart 1.4.9.4 在 Lighttpd 1.4.19-5+lenny2 上重定向
最近我一直在研究 Opencart 作为简单电子商务网站的解决方案。我非常喜欢它,但我似乎无法正确重定向。
我使用 lighttpd 作为 Web 服务器,并且我注意到 Opencart 为 SEO URL 提供了 Apache .htaccess 配置,但 lighttpd 没有运气。
Opencart 使用如下形式的 URL:
登录页面:
http://[domain]/index.php?route=account/login
产品页面:
http://[domain]/index.php?route=product/product&product_id=51
理想情况下,我想要这样的内容:
登录页面:
http: //[domain]/index.php/account/login
产品页:
http://[domain]/index.php/product/51/[产品名称]
当然,任何指向正确方向的指针都会受到高度赞赏。即使是关于在 Lighty 中如何找到处理重写的正确方法的简短解释也会有所帮助!
提前致谢。
Recently I've been looking into Opencart as a solution for simple E-commerce websites. I like it a lot, but I can't seem to get the redirection right.
I am using lighttpd as a web server, and I've noticed that Opencart offers Apache .htaccess configuration for SEO URL's, but no luck for lighttpd.
Opencart uses URLs that are formed like this:
Login Page:
http://[domain]/index.php?route=account/login
Product Page:
http://[domain]/index.php?route=product/product&product_id=51
Ideally, I would like to have something like this:
Login Page:
http://[domain]/index.php/account/login
Product Page:
http://[domain]/index.php/product/51/[product-name]
Of course, any pointers in the right direction are highly appreciated. Even a short explanation of where to find the right way to handle rewrites in Lighty would be helpful!
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,很多人都对 1 4 19-5lenny 及更早的版本有过疑问。如果您想按照上面的方式重写 url,则需要使用自己的自定义挂钩自行解析它们(请参阅 index.php 中的 preAction 以了解默认情况下处理它们的信息)。请注意,您还需要手动编辑 url(例如帐户 1),因为它们在输出之前甚至不会通过 url 重写器发送
A lot of people have had issues with 1 4 19-5lenny and earlier apparently. If you want to rewrite urls the way you have above, you will need to parse them yourself using your own custom hook (see the preAction in the index.php for handling them by default). Note that you will also need to manually edit urls like the account one since they aren't even sent through the url rewriter before being output