2011-09-09 4 views
0

나는 htaccess로 파일을 생성하고 리디렉션 URL로 전체 쿼리 문자열을 전달하지 PL = 값 2내가 현재 긴 URL이처럼 보이는이, htaccess로

내가 좋아하는보고를 리디렉션 할

:

seconddomain.com/directory/subdirectory/1000

(즉, 그냥 전달 된 ID 키의 값을 사용). 그러나

RewriteEngine on 
RewriteCond %{QUERY_STRING} ^id=([0-9]+).*$ 
RewriteRule ^file.aspx$ http://seconddomain.com/directory/subdirectory/%1 [R=301,L] 

, 내가 그만 둘 것입니다 :

이 내가 사용하고 무엇

http://seconddomain.com/directory/subdirectory/1000?id=1000&AE=value1&PL=value2

ID의 값 즉

올바른 자리에 넣어 도착 - 그러나 전체 쿼리 문자열이 추가됩니다. QSA 플래그가 없습니다.

내가 뭘 잘못하고 있니?

미리 감사드립니다.

답변

2

나는 당신이 도움이된다면 자신, 그것을 무시하고 볼 리디렉션 경로의 끝에 ?을 고집하려고 하나를 설정하지 않으면 쿼리 문자열이 자동으로 추가됩니다 생각

편집

그냥 다음과 같을 것입니다 코드를 명확하게 :

RewriteEngine on 
RewriteCond %{QUERY_STRING} ^id=([0-9]+).*$ 
RewriteRule ^file.aspx$ http://seconddomain.com/directory/subdirectory/%1? [R=301,L]