我正在尝试使用以下规则将http://old.domain.com/fr/重定向到http://brand.new-domain.com/fr/,但这不起作用:
# Enable Rewrite Engine RewriteEngine On RewriteBase / # Add a trailing slash to paths without an extension RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ RewriteRule ^(.*)$$1/ [L,R=301] # Redirect domain Options +FollowSymLinks RewriteCond %{HTTP_HOST} ^old.domain.com [OR] RewriteCond %{HTTP_HOST} ^other-old.domain.com [NC] RewriteRule ^(.*)$http://brand.new-domain.com/$1 [r=301,L] # Remove index.PHP # Uses the "exclude method" # http://expressionengine.com/wiki/Remove_index.PHP_From_URLs/#Exclude_List_Method # This method seems to work best for us,you might also use the include method. # http://expressionengine.com/wiki/Remove_index.PHP_From_URLs/#Include_List_Method # Exclude root files RewriteCond $1 !^(index\.PHP) [NC] # Exclude EE folders RewriteCond $1 !^(assets|ee-admin|images|templates|themes|fr|nl)/ [NC] # Exclude user created folders RewriteCond $1 !^(assets|css|img|js|swf|uploads)/ [NC] # Exlude favico,robots,ipad icon RewriteCond $1 !^(favicon\.ico|robots\.txt|pple-touch-icon\.png) [NC] # Remove index.PHP RewriteCond %{QUERY_STRING} !^(ACT=.*)$[NC] RewriteCond %{QUERY_STRING} !^(URL=.*)$[NC] RewriteRule ^(.*)$/index.PHP?/$1 [L]
它在我调用根URL时正确地重定向,但在我调用页面时却没有.我究竟做错了什么?
提前致谢!
光伏