有没有办法阻止.htaccess重写来自特定域的网址?
例如:
example.com/test
通常会重写为example.com/pages/test.php
beta.example.com/test
不会重写。所以转到beta.example.com/test
(同一个)
基本上,寻找子域并停止所有重写的规则是什么?
答案 0 :(得分:3)
将其添加到htaccess文件的顶部:
RewriteCond %{HTTP_HOST} ^beta\.example\.com$ [NC]
RewriteRule ^ - [L]
如果请求是beta.example.com
,它会通过整个重写引擎传递URI而不会弄乱它。