Zend 框架重新路由以实现友好的 SEO URL?
我什至不明白从哪里开始使用文档及其说明。有点傻眼。
我有网址: http://www.site.com/test/view/?aid=155" rel="nofollow">http://www.site.com/test/view/?现在援助=155。
我希望它显示为 http://www.site.com/test/155 (使用控制器“测试”和操作“视图”,参数辅助为 155)
,对于未来的学习经验,我会如何做 http://www.site.com/madeupname/155
我该从哪里开始?什么文件?
我在里面放什么?
请并谢谢你们!!!!
I don't even understand where to start using the documentation and it's instructions. A little dumbfounded.
I have the URL : http://www.site.com/test/view/?aid=155 right now.
I want it to show up as http://www.site.com/test/155 (Using controller "test" and action "view" with parameter aid as 155)
and for future learning experiences, how would I do http://www.site.com/madeupname/155
Where would I start? What file?
What do I put in it?
Please and thank you!!!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这并不难做到,特别是当您使用 .ini 文件作为路线时。
在/site/application/configs 文件夹中创建一个routes.ini 文件。
例如:
然后引导它
(在 bootstrap.php 中添加此内容)
然后您可以使用 www.site.com/login/yourname/yourpass 访问登录页面
或通过 www.site.com/home 访问主页
< a href="http://www.devpatch.com/2010/02/load-routes-from-routes-ini-config-file-in-zend-application-bootstrap/" rel="nofollow">http://www.devpatch.com/2010/02/load-routes-from-routes-ini-config-file-in-zend-application-bootstrap/
http://framework.zend.com/manual/en/zend.controller.router.html
It's not that hard to do, especially if you use an .ini file for your routes.
Create a routes.ini file inside of your /site/application/configs folder.
For example :
and then bootstrap it
(inside bootstrap.php, add this)
You could then access the login page with www.site.com/login/yourname/yourpass
or get to the home page via www.site.com/home
http://www.devpatch.com/2010/02/load-routes-from-routes-ini-config-file-in-zend-application-bootstrap/
http://framework.zend.com/manual/en/zend.controller.router.html