2012-09-05 5 views
0

URL ".php"또는 ".html"또는 "?"을 사용할 때 .htaccess 리디렉션 페이지를 사용하는 방법. 또는 "="? 페이지 리디렉션을 사용 중입니다. htaccess

Examples 
http://www.domain.ltd/index.php  # error, execute redirect to http://www.domain.ltd/ban/ 
http://www.domain.ltd/index/?id=foo # error, execute redirect to http://www.domain.ltd/ban/ 
http://www.domain.ltd/index.html # error, execute redirect to http://www.domain.ltd/ban/ 

당신에게 코드 조각에서 촬영

답변

0

대단히 감사합니다 : http://www.webconfs.com/how-to-redirect-a-webpage.php

Options +FollowSymlinks 
RewriteEngine on 
rewritecond %{http_host} ^domain.com [nc] 
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc] 

분명 페이지에 domain.com을 교체합니다. 이 리디렉션은 domain.com으로 오는 모든 것을보고 www.domain.com으로 전달합니다.

빠른 Google이 나를 위해 멋진 htaccess 생성기를 제작했습니다 (그러나 지금은 게시 할 수 없습니다).

+1

하지만 내 질문에 대답하지 않습니다 :-( – Charlie

+0

다음을 시도해보십시오. 리디렉션 된 위치로 재생해야 할 수 있습니다. RewriteRule^index \ .php $/ban [NC, R] –

관련 문제