2012-10-06 6 views
0

example1.com/folder 또는 www.example1.com/folder에서 실행중인 WordPress 블로그가 있습니다. 이제 example2.com 또는 www.example2.com으로 리디렉션해야합니다. .htaccess를 사용하여 어떻게 할 수 있습니까?도메인 하위 폴더 워드 프레스의 .htaccess를 사용하여 도메인으로 리디렉션

+0

이되고 나는이 내 htaccess로 파일에 다음 코드 : # BEGIN WordPress RewriteEngine 켜기 RewriteBase/ RewriteRule^index \ .php $ - [L] RewriteCond % {REQUEST_FILENAME}! -f RewriteCond % {REQUEST_FILENAME}! -d RewriteRule. /index.php [L] # END WordPress – uvishere

답변

0
RewriteEngine On 

RewriteCond %{HTTP_HOST} ^((www.)?)example1.com [NC] 
RewriteRule ^folder/(.*)$ http://www.example2.com/$1 [R=301,L] 

www.example1.com 또는 example.com에 대한 트래픽을 수신 그래서 예를 들어 www.example2.com/.*/folder/.*에가는 것도 보내는 경우 경우 검사 :

www.example1.com/folder/blah.htmlwww.example2.com/blah.html

+0

리디렉션이 작동하지 않아 죄송합니다. www.greatwayonine.com/np 페이지 나 greatwayonine.com 뒤에있는 폴더를 www.onlinegreatway.com으로 리디렉션하고 싶습니다. 그러나 페이지에 오류가 여전히 발견되지 않았습니다. @Peter의 모든 솔루션? – uvishere

+0

'RewriteCond % {HTTP_HOST}^((www.)) greatwayonine.com [NC]' 'RewriteRule^(. *) $ http://www.onlinegreatway.com/$1 [R = 301, L]' 동일한 폴더 구조가 있다고 가정합니다. 즉, onlinegreatway.com/np도 있습니다. – Peter

관련 문제