私はthinkingmonkey.me
とthinkingmonkey.com
の2つのURLには、両方ともip-address 127.0.0.1(A.K.A localhost)というURLがあります。mod_rewrite `リダイレクト` how?
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>
私はthinkingmonkey.com
URLがthinkingmonkey.me
にリダイレクトされませんアクセスしようとします。ブラウザのアドレスバーにあるURLはthinkingmonkey.com
のままです。
私は間違っていますか?
RewriteEngine On
RewriteCond %{HTTP_HOST} !.*thinkingmonkey\.me$
RewriteRule ^/(.*)$ http://thinkingmonkey.me/$1 [R]
ドキュメント:
*そう*多くの重複:あなたは本当に、本当にあなたが
thinkingmonkey.com
のVirtualHost
セクションに次の行を置くことができるmod_aiasを使用したい場合は:あなたは、次のコードを使用することができます。 –