我想删除hmvc代码点火器中的index.php,当我键入没有index.php的url时,它运行良好,但是当我处理到其他控制器时,url会在我的codeigniter文件夹之后自动显示index.php。
示例I键入:
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>请有人帮我
发布于 2017-04-03 03:44:41
您可以在配置文件夹中的config.php中进行更改,您可以看到行
$config['index_page'] = 'index.php';将这一行改为
$config['index_page'] = '';我希望这能帮到你
发布于 2017-04-03 05:33:49
将此代码放入.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]https://stackoverflow.com/questions/43175647
复制相似问题