Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Codeigniter 在hmvc中删除index.php_Codeigniter_Url_Codeigniter Hmvc - Fatal编程技术网

Codeigniter 在hmvc中删除index.php

Codeigniter 在hmvc中删除index.php,codeigniter,url,codeigniter-hmvc,Codeigniter,Url,Codeigniter Hmvc,我想删除hmvc code igniter中的index.php,当我键入不带index.php的url时,它运行良好,但当我处理到其他控制器时,url会在我的codeigniter文件夹后自动显示index.php 示例一类型: localhost/ci_hmvc/user/login 当我处理到其他控制器时,结果是: localhost/ci_hmvc/index.php/user/dashboard 还有我的.htaccess <IfModule mod_rewrite.c&g

我想删除hmvc code igniter中的index.php,当我键入不带index.php的url时,它运行良好,但当我处理到其他控制器时,url会在我的codeigniter文件夹后自动显示index.php

示例一类型:

localhost/ci_hmvc/user/login 
当我处理到其他控制器时,结果是:

localhost/ci_hmvc/index.php/user/dashboard
还有我的.htaccess

<IfModule mod_rewrite.c> 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /ci_hmvc/index.php/$1 [L]
</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$/ci_hmvc/index.php/$1[L]

请任何人帮助我

您可以在config文件夹中的
config.php
中进行更改 你可以看到那条线

$config['index_page'] = 'index.php';
将此行改为

$config['index_page'] = '';

我希望这将帮助您

您可以在config文件夹中的
config.php
中进行更改 你可以看到那条线

$config['index_page'] = 'index.php';
将此行改为

$config['index_page'] = '';

我希望这将帮助您

将此代码放入.htaccess并将htaccess文件放置到文件夹的根目录中

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]

将此代码放在.htaccess中,并将htaccess文件放在文件夹的根目录下

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]

login.php控制器上有重定向吗?login.php控制器上有重定向吗?还要检查base_url中有什么,还要检查base_url中有什么