开通了博客园页面,深深的被其简洁干净所吸引,顿时想将自己的个人域名重定向到博客园页面。
本来自己有一台 AWS EC2 主机,使用 Apache 修改下配置即可。
1. 生成新配置文件 redirect_subdomains.conf
- # Enable Virtual Host
- NameVirtualHost *:80
- # Setup redirection
- <VirtualHost *:80>
- ServerName blog.zhengyongfeng.cn
- Redirect permanent / http://www.cnblogs.com/yongfeng01/
- ErrorLog logs/blog.zhengyongfeng.cn-error_log
- CustomLog logs/blog.zhengyongfeng.cn-access_log common
- </VirtualHost>
2. 将编辑好的新文件放在 /etc/httpd/conf.d 即可,然后重启 apache
- service httpd restart
- Stopping httpd: [ OK ]
- Starting httpd: [ OK ]
3. 访问新链接 http://blog.zhengyongfeng.cn 即可重定向到 http://www.cnblogs.com/yongfeng01/
来源: http://www.bubuko.com/infodetail-2427814.html