Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/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
Php ModRewrite不适用于codeigniter站点_Php_.htaccess_Codeigniter - Fatal编程技术网

Php ModRewrite不适用于codeigniter站点

Php ModRewrite不适用于codeigniter站点,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我为我的codeigniter站点尝试了modrewrite,但是当我进入htaccess文件时,已经有一个了 RewriteEngine on RewriteCond $1 !^(index\.php?|combine\.php?|_images|assets|_styles|_js|favicon\.ico?|dashboard|mail) RewriteRule ^(.*)$ /index.php/$1 [L] 然而,当我试图在xxamp中本地测试我的站点时,我必须放入index.php

我为我的codeigniter站点尝试了modrewrite,但是当我进入htaccess文件时,已经有一个了

RewriteEngine on
RewriteCond $1 !^(index\.php?|combine\.php?|_images|assets|_styles|_js|favicon\.ico?|dashboard|mail)
RewriteRule ^(.*)$ /index.php/$1 [L]
然而,当我试图在xxamp中本地测试我的站点时,我必须放入
index.php
,这会破坏我所有的样式链接。有什么我遗漏的吗?当站点处于活动状态时,它不是必需的


编辑:这个网站是在osx上的MAMP上开发的,我在windows上使用xampp,你认为这可能是问题的一部分吗?

apache正在寻找.htaccess文件吗?您可能需要检查配置。

在我的CI项目中,我在.htaccess中有此数据


httpdc.conf说了几件事:
AllowOverride All
Order allow,deny deny from All said All
这通常是codeigniter或php的属性吗?mod_rewrite是一个Apache模块,就是这样做的!非常感谢。这是一个很好的评论,因为我从来并没有猜到这一切都发生了什么。
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]