Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
.htaccess codeigniter隐藏模式在url中重新写入hide index.php不适用于本地主机_.htaccess_Codeigniter_Mod Rewrite - Fatal编程技术网

.htaccess codeigniter隐藏模式在url中重新写入hide index.php不适用于本地主机

.htaccess codeigniter隐藏模式在url中重新写入hide index.php不适用于本地主机,.htaccess,codeigniter,mod-rewrite,.htaccess,Codeigniter,Mod Rewrite,我使用的是mamp或mac操作系统,codeigniter版本2.1.3。默认情况下,Codeigniter文件夹结构为。这很基本 我想在url中隐藏index.php。您将如何执行此操作?将您的.htaccess文件更改为: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ index.php?$1 [L] 对于我来说,主页和“reg”页面加载很好,没有index.php

我使用的是mamp或mac操作系统,codeigniter版本2.1.3。默认情况下,Codeigniter文件夹结构为。这很基本


我想在url中隐藏index.php。您将如何执行此操作?

将您的
.htaccess
文件更改为:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php?$1 [L]
对于我来说,主页和“reg”页面加载很好,没有
index.php