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-mod_重写在生产服务器中不工作_.htaccess_Codeigniter_Mod Rewrite_Production - Fatal编程技术网

.htaccess Codeigniter-mod_重写在生产服务器中不工作

.htaccess Codeigniter-mod_重写在生产服务器中不工作,.htaccess,codeigniter,mod-rewrite,production,.htaccess,Codeigniter,Mod Rewrite,Production,在生产服务器上设置模式_rewrite时出现以下错误: 尝试使用ErrorDocument处理请求时遇到404 Not Found错误 我在应用程序文件夹外有index.php,因此我相应地将路径设置为$application\u folder&$system\u path 我的文件夹结构: folder_A: folder_A1: index.php js css folder_A2: application sy

在生产服务器上设置模式_rewrite时出现以下错误:

尝试使用ErrorDocument处理请求时遇到404 Not Found错误

我在应用程序文件夹外有index.php,因此我相应地将路径设置为
$application\u folder
&
$system\u path

我的文件夹结构:

  folder_A:
    folder_A1:
      index.php
      js
      css
    folder_A2:
      application
      system
这是文件夹_A1中的.htaccess

RewriteEngine on<br>
RewriteCond %{REQUEST_FILENAME} !-f<br>
RewriteCond %{REQUEST_FILENAME} !-d<br>
RewriteRule ^(.*)$ index.php/$1 [L]
重新启动引擎
重写cond%{REQUEST_FILENAME}-f
重写cond%{REQUEST_FILENAME}-d
重写规则^(.*)$index.php/$1[L]
我已经给出了
$config['index_page']=''

我曾尝试将base重写为“/”和“path/to/app”,但都没有成功


能否找到解决方案?

您有权在.htaccess文件中配置重写规则吗?我在.htaccess中为我的CI应用程序使用了完全相同的规则,并且它正在工作。您的apache配置文件中是否有类似于
AllowOverride ALL
的行?

据我所知,您的CI文件夹结构应该是这样的,以便使用该模块重写:

root/.htaccess
root/index.php
root/assets/js
root/assets/css
root/assets/img

root/application
root/system

更改
.htaccess
文件内容如下:

重新启动发动机

重写cond%{REQUEST_FILENAME}-f

重写规则^index.php[QSA,L]

要求全部拒绝

全盘否定