2017-07-04 89 views

回答

0

剛剛找到了一個解決方案。謝謝:)

RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] 
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^([^.]+).html/ http://somedomain.com/$1\.html [R=301,L] 
RewriteCond %{REQUEST_URI} !^/administrator/ 
RewriteCond %{REQUEST_URI} !\.(php|html?|jpg|gif)$ 
RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301] 
RewriteCond %{REQUEST_URI} !^/administrator/ 
RewriteCond %{REQUEST_FILENAME} !-d 

之前不能這樣做,因爲需要排除/管理者/排除兩次