![Apache 重写规则子页面无限循环](https://linux22.com/image/611327/Apache%20%E9%87%8D%E5%86%99%E8%A7%84%E5%88%99%E5%AD%90%E9%A1%B5%E9%9D%A2%E6%97%A0%E9%99%90%E5%BE%AA%E7%8E%AF.png)
我正在尝试将 toast.allthesmarts.com 重定向到 toast.allthesmarts.com/dayone
RewriteEngine on
RewriteCond %{HTTP_HOST} toast.allthesmarts.com
RewriteRule ^(.*)$ http://toast.allthesmarts.com/dayone/ [L,R,QSA]
但这给了我无限循环。我尝试了这个:
RewriteCond %{HTTP_HOST} ^toast.allthesmarts.com$
RewriteCond %{REQUEST_URI} !^/dayone$
RewriteRule ^(.*)$ http://toast.allthesmarts.com/dayone/ [L,R,QSA]
但它不起作用!我已经这样做了很多次了,但今天我的脑袋不灵光了!请帮忙
注意:还有其他网站通过相同的 apache 运行
答案1
更改“RewriteCond %{REQUEST_URI} !^/dayone$”
到 'RewriteCond %{REQUEST_URI} !^/dayone/$'