2009-11-20 3 views
0

동적 URL 리디렉션에 문제가 있습니다. htaccess 쿼리 문자열을 리디렉션하고 무시합니다.

Redirect 301 /content/index.php?id=423 http://www.domain.com/new-page/ 

내가이

RewriteCond %{QUERY_STRING} ^(([^&]*&)*)id=423$ 
RewriteRule ^content/index\.php$ http://www.domain.com/new-page [L,R=301] 

을 시도했지만 운이 없었 : 이것은 내가 달성하고자하는 것입니다. 고맙습니다! PS/ 는이 코드 당신은 대체 URL에서 쿼리를 지정해야합니다

RewriteRule ^([^.]+)/([A-Za-z]*)-([^.]+)-([0-9]+).html$ $1/$4-$2-$3.html [L,R=301] 

답변

4

와 일부 파라 작업을 잃었다.

RewriteCond %{QUERY_STRING} ^id=423$ 
RewriteRule ^content/index\.php$ http://example.com/new-page? [L,R=301] 

을 그리고 당신은 다른 URL 인수를 유지하려는 경우,이 시도 : 그렇지 않으면 원래 쿼리는 촬영

RewriteCond %{QUERY_STRING} ^(([^&]*&)*)id=423&*([^&].*)?$ 
RewriteRule ^content/index\.php$ http://example.com/new-page?%1%3 [L,R=301] 
관련 문제