如何指定 SEO 友好的 url,如 twitter www.twitter.com/使用YII框架
我目前正在使用 Yii 框架,我想知道是否有人知道如何在 Yii 中自动设置 SEO 友好的 url,例如 www.twitter.com/ ?我知道如何在 config/main.php 中手动执行此操作,但我希望能够动态生成它。我在 Grails 中也能做到这一点。在 Yii 中,我知道你需要另一个参数,比如 www.twitter.com/l/,但我不想要那个参数,任何人都可以分享吗?
谢谢。
I am currently using the Yii framework, and I would like to know if anyone has any clue on how to setup a SEO friendly url like www.twitter.com/ automatically in Yii? I know how to do so this manually in the config/main.php but I would like to be able to dynamically generate it. I have been able to do it in Grails as well. In Yii, what I know of is that you need to have another parameter like www.twitter.com/l/, but I do not want that parameter, anyone can share?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑配置文件 main.php 与此
我认为它是在您使用 yiic-tool 创建 web 应用程序时生成的
Edit the config file main.php with this
I think it is generated when you create a webapp with yiic-tool
您是否无法使用 URL Manager 实现您想要的效果?如果没有,您能否发布一个示例,说明您当前拥有的以及您希望它是什么?
Are you not able to achieve what you want by using the URL Manager? If not, can you post an example of what you have currently and what you'd like it to be?