【问题标题】:Configuring Cakephp routes配置 Cakephp 路由
【发布时间】:2011-07-01 09:17:42
【问题描述】:

我已经构建了一个简单的应用程序。我想配置这样的路由。

 domain_name.com/@username 

 Router::connect('/@*', array('controller' => 'users', 'action' => 'profile')); 

但它不起作用。它给出了错误页面找不到。无论如何我可以让 domain.com/@username 工作。

感谢您的帮助。

谢谢。

【问题讨论】:

  • @ 是 URL 中的特殊字符。我认为如果不对其进行 URL 编码,您将无法使其工作。

标签: php cakephp routes cakephp-1.3


【解决方案1】:

Mark Story 发表了一篇关于如何在 CakePHP 1.3 中使用自定义路由类来实现此目的的优秀文章。如果您遵循本指南,则绝对不需要使用 @ 符号来实现此目的。希望这会有所帮助。

Using custom Route classes in CakePHP

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-03-03
    • 1970-01-01
    • 1970-01-01
    • 2011-03-17
    • 1970-01-01
    • 1970-01-01
    • 2012-02-16
    • 2014-01-01
    相关资源
    最近更新 更多