Mod rewrite .htaccess URL重写代码点火器不工作

Mod rewrite .htaccess URL重写代码点火器不工作,mod-rewrite,codeigniter-2,Mod Rewrite,Codeigniter 2,我在/home/domain/public\u html/子文件夹中有以下.htaccess 但这不起作用 文件不存在:/home/domian/public\u html/public 显然我的重写规则搞砸了。整个CI应用程序位于web根目录的子文件夹中 /home/domain/public_html/subfolder [sssss@ff subfolder]$ ls application license.txt public system user_guide 并且index

我在/home/domain/public\u html/子文件夹中有以下.htaccess

但这不起作用

文件不存在:/home/domian/public\u html/public

显然我的重写规则搞砸了。整个CI应用程序位于web根目录的子文件夹中

/home/domain/public_html/subfolder
[sssss@ff subfolder]$ ls
application  license.txt  public  system  user_guide

并且index.php是公开的。

首先,您的index.php应该与应用程序和系统位于同一目录中

移动后,请在.htaccess中尝试此操作

RewriteEngine on
RewriteBase /subfolder/
RewriteCond $1 !^(index\.php|user_guide|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
还有一点与此无关,我会删除用户指南目录,因为它包含的所有内容都可以在上访问

RewriteEngine on
RewriteBase /subfolder/
RewriteCond $1 !^(index\.php|user_guide|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]