之前,它是可能的,但可能不是做重定向的理想場所。如果添加此JavaScript來所有的頁面上twigplay.com它會處理重定向你:
<script type="text/javascript">
(function(){
// changes the location's hostname, the path remains the same
// so if you're at http//twigplay.com/whatever/the/url.html it will
// redirect to http://mimuz.com/whatever/the/url.html
window.location.hostname = 'mimuz.com';
})();
</script>
這可能是更理想的設置您的服務器上的重定向雖然發出HTTP 301通信的事實您已將內容移至新域名。如果您使用的是Apache網絡服務器,則您希望使用mod_rewrite來發出重定向。規則樣本集,你會放在你的.htaccess
文件:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^twigplay\.com$
RewriteRule ^(.*)$ http://mimuz.com/$1 [L,R=301]
這實際上告訴Apache將重定向去twigplay.com任何URL重定向到相同的URL,但在mimuz.com和發出一個HTTP 301 Moved Permanently頭部,它會通知搜索引擎,他們對原始網址的任何信息都應該適用於新的。
真的老兄?下次通知NSFW。 – MonkeyZeus