【问题标题】:add site/index.php/city as a codeigniter url routing not working添加 site/index.php/city 作为 codeigniter url 路由不起作用
【发布时间】:2019-07-20 05:05:54
【问题描述】:

我已经为我的网站编写了 codeigniter URL 路由,路由是

$route['index.php/([a-zA-Z0-9---_%])+'] = 'site/index/$1';

当我尝试访问如下链接时

http://localhost/site/index.php/india

不工作,它重定向到 404 页面。

【问题讨论】:

    标签: php .htaccess codeigniter url url-routing


    【解决方案1】:

    如果你有链接

    http://localhost/site/index.php/india
    

    你需要写这条路线:

    $route['site/index.php/(:any)'] = 'site/index/$1';
    

    【讨论】:

      猜你喜欢
      • 2013-04-06
      • 2012-01-17
      • 1970-01-01
      • 1970-01-01
      • 2011-11-07
      • 2018-06-27
      • 1970-01-01
      相关资源
      最近更新 更多