1
所以,我有一些問題,我的htacces文件試圖做一些重寫條件。 我想要做的是:Apache htaccess mod重寫
有多個域指向此web文件夾。 如果域名是什麼,但example.com我希望它重寫example.com 除非 - 路徑是/路徑
惟獨當你去www.otherexample.com/path
現在工作這是擊中最後一條規則,並將網址更改爲http://dev.otherexample.com/index.php?qs-rewrite=path並導致重定向循環。
這裏就是整個htaccess文件
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase/
RewriteCond %{HTTP_HOST} !example\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/path [NC]
RewriteRule ^.*$ http://dev.example.com%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qs-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>
我想,和同樣的事情,我加入了整個htaccess的的問題。 –
您使用什麼URL測試此規則? – anubhava
你現在可以嘗試編輯答案嗎? – anubhava