2011-09-20 4 views
0

이 내 규칙은 내 .htaccess 파일에서 원하는대로 모두 리디렉션됩니다. 일치하지 않는 요청 secure.x.com/en/account?x=1 ~ x.com/en/account?x=1secure.x.com/en/account/xxxx과 같은 요청은 리디렉션해서는 안됩니다.리디렉션 문제가 다른 도메인에 대한 경로를 선택했습니다.

Options Indexes FollowSymLinks 
RewriteEngine On 

RewriteCond %{HTTP_HOST} secure.x.com [NC] 
RewriteCond %{REQUEST_URI} !^[a-z-]{2,8}/account [NC] 
RewriteRule (.*) http://x.com%{REQUEST_URI} [R=301,L] 

RewriteRule !\.(css|gif|htm|html|ico|jpg|js|pdf|php|png|swf|txt|xml)$ index.php 

이 규칙은 같은 요청 secure.x.com에 대한

을 x.com/en/noaccount로 리디렉션하지만> secure.x.com/en/noaccount = 같은 URL에 대해 잘 작동/ko/account

해당 규칙의 문제점은 무엇입니까?

답변

0

내 문제에 대한 해결책을 찾았습니다. 이것이 최적의 솔루션인지는 모르겠지만 작동합니다.

Options Indexes FollowSymLinks 
RewriteEngine On 

RewriteCond %{ENV:REDIRECT_STATUS} 200 
RewriteRule .* - [S=3] 

RewriteCond %{HTTP_HOST} local.secure.x.com [NC] 
RewriteCond %{REQUEST_URI} ![a-z]{2,8}/account [NC] 
RewriteRule ^(.*)$ http://local.x.com/$1 [R=301,L] 

RewriteRule !\.(css|gif|htm|html|ico|jpg|js|pdf|php|png|swf|txt|xml)$ index.php 

누군가에게 더 좋은 아이디어가 있다면 알려주세요. tnx.

관련 문제