2012-01-14 5 views
0

나는 2 개의 URL이 thinkingmonkey.me이고 thinkingmonkey.com은 모두 IP 주소가 127.0.0.1 (A.K.A 로컬 호스트)입니다.mod_rewrite`리디렉션 '하는 방법?

모든 요청을 thinkingmonkey.com (으)로 thinkingmonkey.me으로 리디렉션하고 싶습니다.

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot /mysite 
    ServerName thinkingmonkey.me 
    ServerAlias www.thinkingmonkey.me 
    ErrorLog logs/dummy-host.example.com-error_log 
    CustomLog logs/dummy-host.example.com-access_log common 
    Options -Indexes +FollowSymLinks 
    RewriteEngine On 
</VirtualHost> 


<VirtualHost *:80> 
    ServerAdmin [email protected] 
    ServerName thinkingmonkey.com 

    Redirect thinkingmonkey.com http://thinkingmonkey.me/ 

    # Redirect/http://thinkingmonkey.me/ #have even tried this 

    ServerAlias www.thinkingmonkey.com 
    RewriteEngine on 
</VirtualHost> 

나는 URL이 thinkingmonkey.me로 리디렉션되지 않습니다 thinkingmonkey.com에 액세스하려고합니다. 브라우저의 주소 표시 줄에있는 URL은 thinkingmonkey.com입니다.

내가 뭘 잘못하고 있니?

+1

* 그래서 * 많은 중복 : 당신이 정말 - 정말 thinkingmonkey.comVirtualHost 섹션에서이 줄을 넣을 수 있습니다 mod_aias를 사용하려면

Options +FollowSymLinks -MultiViews RewriteEngine on RewriteCond %{HTTP_HOST} ^(.*\.)?thinkingmonkey\.com$ [NC] RewriteRule^http://%1thinkingmonkey.me%{REQUEST_URI} [L,R=301] 

: 당신은 다음과 같은 코드를 사용할 수 있습니다. –

답변

1

mod_rewrite는 더 나은 이러한 재 작성을 처리 할 더 강력한 것으로 간주됩니다.

Redirect 301/http://thinkingmonkey.me/ 
관련 문제