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
.htaccess wamp中的htaccess重定向不工作_.htaccess_Codeigniter - Fatal编程技术网

.htaccess wamp中的htaccess重定向不工作

.htaccess wamp中的htaccess重定向不工作,.htaccess,codeigniter,.htaccess,Codeigniter,.htaccess在服务器上托管时工作正常,但在wamp中不工作。我需要删除Codeigniter对/index.php的需求。下面是我的代码 <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on #AllowOverride All RewriteBase / RedirectMatch 403 ^/(application\/cache|codeigniter|\.git|\.hg).*$ Rewrit

.htaccess在服务器上托管时工作正常,但在wamp中不工作。我需要删除Codeigniter对/index.php的需求。下面是我的代码

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
#AllowOverride All
RewriteBase /
RedirectMatch 403 ^/(application\/cache|codeigniter|\.git|\.hg).*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
#RewriteRule ^(.*\.html)$ /cms/ [NC]
</IfModule>
<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
</IfModule>

选项+FollowSymLinks
重新启动发动机
#允许超越所有
重写基/
重定向匹配403^/(应用程序\/cache | codeigniter | \.git | \.hg)*$
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]
#重写规则^(.\.html)$/cms/[NC]
重写规则^(.*)$index.php?/$1[L]

原因是我忘记打开Apache中的“重写”模块:-(

这并不提供问题的答案。若要评论或要求作者澄清,请在他们的帖子下方留下评论-你可以随时对自己的帖子发表评论,一旦你有足够的评论,你就可以发表评论。@Manish-这在什么方面不是问题的答案?按照我的阅读方式,OP是在回答自己的问题stion,告诉我们问题是什么。答案是@Manish…我回答了我自己的问题,.htaccess没有问题…我只是忘了在Apache中打开rewrite_模块