【问题标题】:Routing in cake php蛋糕php中的路由
【发布时间】:2013-01-23 13:16:01
【问题描述】:

我有以下网址

example.com/show.php?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

我想将它重定向到控制器测试操作重定向。 我如何通过 cake php 路由或通过 htaccess 来实现这一点。

【问题讨论】:

    标签: php .htaccess cakephp routing


    【解决方案1】:

    您可以在app/Config/routes.php 文件中为此输入一个简单的路由:

    Router::connect('/show.php', array('controller' => 'tests', 'action' => 'redirs'));
    

    如果需要,您可以在您的操作中处理查询字符串中传递的任何内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-20
      • 1970-01-01
      相关资源
      最近更新 更多