301重定向

除了在.htaccess设置外,在apache2的地方也可以设置。

修改/etc/apache2/sites-enabled

打开配置文件,比如公司网站就是www.365daohang.com

加上 ServerAlias creadeal.com

 作用指向同一个目录

<VirtualHost *:80>
        ServerAdmin system@creadeal.com
        ServerName 365daohang.com
        RedirectMatch 301 ^(.*) http://www.365daohang.com/

</VirtualHost>

 

再加上上面一段代码,重启apache就ok了!

posted @ 2014-06-11 08:18  帽子戏法  阅读(148)  评论(0编辑  收藏  举报
全部 html css js Linux php MySQL seo web git other 联系 管理