如何将子域重定向到另一个网站? [英] How to redirect a subdomain to another website?
问题描述
我希望该子域名转移到我的博客 http://myblog.blogspot.in/
现在我有一个名为 subdomain
在我的根文件夹。我应该在该文件夹中上传什么,以便将其重定向到我的博客?
使用.htaccess文件或创建PHP脚本包含以下内容:
<?php
header('HTTP / 1.1 301 Moved Permanently'
header('Location:http://the-network-king.blogspot.in');
创建301重定向。
并将文件保存在名称 index.php
下,否则它不会选择文件。
I bought domain www.mydomain.com from godaddy.com. I hosted it at www.000webhost.com (free web-domain-hosting site). I created a subdomain subdomain.mydomain.com through ccpanel of 000webhost.
I want that subdomain to be diverted to my blog http://myblog.blogspot.in/
Right now I have a folder named subdomain
in my root folder. What shall I upload in that folder so that It gets redirected to my blog?
Use either a .htaccess file or create a PHP script with the following:
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://the-network-king.blogspot.in');
To create a 301 redirect.
and save the file under name index.php
else it wont pick up file.
这篇关于如何将子域重定向到另一个网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!