【发布时间】:2012-02-10 13:36:33
【问题描述】:
我有 2 个网址说 thinkingmonkey.me 和 thinkingmonkey.com 都有 ip-address 127.0.0.1 (A.K.A localhost)。
我想将任何请求重定向到thinkingmonkey.com 到thinkingmonkey.me。
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
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 webmaster@dummy-host.example.com
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。
我做错了什么?
【问题讨论】:
标签: apache mod-rewrite url-rewriting apache2 httpd.conf