1、添加域名解析,用别名来做。
vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
添加一条: ServerAlias www.123rencai.com
保存退出。
2、做301跳转,修改.htaccess文件。
vim /data/home/www/www/.htaccess
RewriteEngine On
RewriteBase /
# Rewrite规则
RewriteRule ^index.htm$ index.php
RewriteRule ^jobs/jobs-show-([0-9]+).htm$ jobs/jobs-show.php?id=$1
RewriteRule ^company/company-show-([0-9]+).htm$ company/company-show.php?id=$1
RewriteRule ^resume/resume-show-([0-9]+).htm$ resume/resume-show.php?id=$1
RewriteRule ^news/news-list-([0-9]+)-([0-9]+).htm$ news/news-list.php?id=$1&page=$2
RewriteRule ^news/news-show-([0-9]+).htm$ news/news-show.php?id=$1
RewriteRule ^explain/explain-show-([0-9]+).htm$ explain/explain-show.php?id=$1
RewriteRule ^notice/notice-list-([0-9]+)-([0-9]+).htm$ notice/notice-list.php?id=$1&page=$2
RewriteRule ^notice/notice-show-([0-9]+).htm$ notice/notice-show.php?id=$1
RewriteEngine on
RewriteCond %{http_host} ^123zp.com [NC]
RewriteRule ^(.*)$ http://www.123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^123zhaopin.com [NC]
RewriteRule ^(.*)$ http://www.123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^123zhaopin.cn [NC]
RewriteRule ^(.*)$ http://www.123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^www.123zhaopin.cn [NC]
RewriteCond %{http_host} ^www.123rencai.com [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^www.123zp.com [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^123zp.cn [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^www.123zp.cn [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^xn--315-yh6Fq51K.com [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^www.315zhaopin.com [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^315zhaopin.com [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^xn--315-yh6Fq51K.xn--fiQs8S [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^www.xn--315-yh6Fq51K.xn--fiQs8S [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
RewriteCond %{http_host} ^www.xn--315-yh6Fq51K.com [NC]
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301]
添加一条 :
RewriteCond %{http_host} ^www.xn--315-yh6Fq51K.com [NC] :需要跳转的域名
RewriteRule ^(.*)$ http://123zp.com/$1 [L,R=301] :主域名
保存退出
/etc/init.d/apachectl restart
重启服务器