httpd.conf,删除rewrite_module (shared) 前面的#
curl -x127.0.0.1:80 -I 123.com //状态码为301
把虚拟主机配置文件改成如下:
<VirtualHost *:80>
DocumentRoot "/data/wwwroot/lgx168.com"
ServerName lgx168.com
ServerAlias www.lgx168.com
CustomLog "logs/lgx168.com-access_log" combined
</VirtualHost>
重新加载配置文件 -t,graceful
curl -x127.0.0.1:80 -I lgx168.com
tail /usr/local/apache2.4/logs/lgx168.com-access_log
11.18 Apache用户认证 11.19/11.20 域名跳转 11.21 Apache访问日志
原文地址:http://blog.51cto.com/12058686/2083659