2

当您输入 aaa.aaa/work1 时,如何替换“work1/public”子目录中的内容?

我测试过

RewriteEngine on
RewriteRule (.*) /work1/public/

但这仅在您要求某事时才有效

http://aaa.aaa/work1/foo

http://aaa.aaa/work1/bar

如果没有输入

http://aaa.aaa/work1

规则不起作用:-(

谁能帮我 ?

非常感谢

aaa.aaa === localhost
4

1 回答 1

2

将此代码放在您的/work1/.htaccess文件中:

RewriteEngine On
RewriteBase /work1/

RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
于 2014-12-09T18:17:53.117 回答