2013-05-20 24 views
0

我正在使用此mod重寫規則將我的網站的首頁重定向到同一網站上的/ it /子目錄。Mod_Rewite排除網址(URI例外)

RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
RedirectMatch 301 ^/$ http://www.example.com/it/ 

不過,我想從被重定向

http://www.example.com/?act=25 

我如何能寫豁免條件做到這一點任何想法免除這個網址?

回答

0

找到了解決辦法

RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
RewriteCond %{QUERY_STRING} !^act=(.*)$ [NC] 
RewriteRule ^$ http://www.example.com/it/ 

哦,還有的RewriteCond不與的情況下工作RedirectMatch你不知道(因爲它,我沒有浪費小時)