Php CodeIgniter URL路由
我当前的url也是在config.php下设置的 但是如何在视图中打开其他页面而不指定index.phpPhp CodeIgniter URL路由,php,codeigniter,Php,Codeigniter,我当前的url也是在config.php下设置的 但是如何在视图中打开其他页面而不指定index.php http:/localhost/ci/Pages/view/login但与此不同http:/localhost/ci/index.php/Pages/view/login您应该看看这个 您可以使用.htaccess文件执行很多操作 请尝试将其放入.htaccess文件中 RewriteEngine on RewriteCond $1 ^(Pages|view|login|P[0-9]{2
http:/localhost/ci/Pages/view/login但与此不同http:/localhost/ci/index.php/Pages/view/login您应该看看这个 您可以使用
.htaccess
文件执行很多操作
请尝试将其放入.htaccess
文件中
RewriteEngine on
RewriteCond $1 ^(Pages|view|login|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
使用application/config/routes.php文件 添加URL路由定义非常简单
有关详细信息,请参阅此链接:您不能直接从“视图”文件夹打开文件。它不像CodeIgniter那样工作,它有一些关于为此设置“重写规则”的文档