我在子文件夹中有其他系统,怎么写.htaccess?

时间:2014-11-08 04:17:35

标签: .htaccess mod-rewrite

如果我有一个PHP系统A(.htaccess如下),我需要将其他系统B子文件夹放在A' s就像htp://www.a.com/B/ 如何更改代码以使其工作? (只是因为我现在键入htp://www.a.com/b/时可以看到登录页面,但是当我登录时,会重定向到htp://www.a.com/index.php)

谢谢!

RewriteEngine On
RewriteBase "/"

RewriteCond %{QUERY_STRING} rewrite
RewriteRule .* - [L]

RewriteRule index\.php(.*) $1 [R=302,L]

RewriteRule ^$ "/index.php?rewrite" [qsa,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_URI} \.(js|css|jpe?g|jpe|gif|png|ico)$ [NC]
RewriteRule .* - [L]

multiple rewrites
RewriteRule /?(.*) "/index.php?rewrite=$1" [qsa,L]

1 个答案:

答案 0 :(得分:0)

RewriteBase下方插入此RewriteRule以跳过目录B

RewriteRule ^B(/.*)?$ - [L,NC]