添加site / index.php / city作为codeigniter url路由无法正常工作

问题描述 投票:0回答:1

我为我的网站编写了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个回答
0
投票

如果你有链接

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

你需要写这条路线:

$route['site/index.php/(:any)'] = 'site/index/$1';
© www.soinside.com 2019 - 2024. All rights reserved.