更新时间:2021-10-12 22:58:08
您可以在测试
添加子域名的限制。
此外,你必须避免去除尾随斜杠的文件夹。(否则:循环 - > 500错误)
You can add a restriction on test
subdomain.
Also, you have to avoid removing trailing slash for folders (otherwise: loop -> 500 error).
那么你的htaccess将成为
Your htaccess would then become
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Don't touch anything when coming from test subdomain
RewriteCond %{HTTP_HOST} ^test\. [NC]
RewriteRule ^ - [L]
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /index.php [L]
</IfModule>