Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/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
Mod rewrite mod_重写对子目录的更改_Mod Rewrite - Fatal编程技术网

Mod rewrite mod_重写对子目录的更改

Mod rewrite mod_重写对子目录的更改,mod-rewrite,Mod Rewrite,你好,我有这个结构 http://localhost/ci2 使用此.htaccess进入ci2 RewriteEngine on RewriteRule ^$ /ci2/index.php [L] RewriteCond $1 !^(index\.php|resource|files|system|user_guide|robots\.txt|favicon\.ico) RewriteRule ^(.*)$ /ci2/index.php/$1 [L] 现在我想把文件移到一个子目录 h

你好,我有这个结构

http://localhost/ci2
使用此.htaccess进入ci2

RewriteEngine on 
RewriteRule ^$ /ci2/index.php [L] 
RewriteCond $1 !^(index\.php|resource|files|system|user_guide|robots\.txt|favicon\.ico) 
RewriteRule ^(.*)$ /ci2/index.php/$1 [L]
现在我想把文件移到一个子目录

http://localhost/folder/ci2
我意识到它不能使用相同的.htaccess文件
那么,需要进行哪些修改

您只需更改为:

RewriteEngine on 
RewriteCond $1 !^(index\.php|resource|files|system|user_guide|robots\.txt|favicon\.ico)
RewriteRule ^folder/ci2/(.*)$ folder/ci2/index.php [L]

现在排序并在我的服务器上测试。