在codeigniter中有没有文件在URL中调用。所有Codeigniter所做的是使用MVC结构来渲染视图。
以及如果您访问根文件夹(index.html或index.php)上的任何内容,它将重定向到应用程序文件夹。然后默认控制器是触发。
CZ根有文件调用index.php
,那里你可以看到
$application_folder = 'application';
$system_path = 'system';
而且你可以看看这个
- 路线 -
config/routes.php
- 控制器 -
controller/
- 模型 -
model/
- view -
view/
我们使用.htaccess
删除URL中的index.php
。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
,如果你想添加URL的.html
或.php
年底
在config/config.php
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
湖中有没有重定向选项? –
那我该如何重定向或触发呢? –
什么重定向?我们使用.htaccess删除index.php中的URL –