Home  >  Article  >  Backend Development  >  关于多个域名指向同一域名,该怎么处理

关于多个域名指向同一域名,该怎么处理

WBOY
WBOYOriginal
2016-06-13 10:07:271012browse

关于多个域名指向同一域名
类似输入kaixin.com自动跳转到renren.com
Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !^(index\.php|images|style|js|system|Scripts|img|php|robots\.txt)
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.123.com/$1 [R=301,L]
RewriteCond %{http_host} ^example.net [NC]
RewriteRule ^(.*)$ http://www.123.com/$1 [R=301,L]
RewriteRule ^(.*)$ index.php/$1 [L]

上面这段代码就想把输入example.com和example.net时候自动跳转到123.com,请教一下有什么问题么?用的是CI框架

------解决方案--------------------
高手快来回答,我也很想知道。
------解决方案--------------------
你找域名供应商给你映射一下就是了

不要闭门造车!
------解决方案--------------------
代码有很多我还看不懂呢
又能解决的没啊?

------解决方案--------------------
301跳转。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn