[英]How to point the subdomain to Main domain sub folder
I have the site domain.com and creates the need subdomain.domain.com
that points to the directory domain.com/public_html/subdomain
我有站点 domain.com 并创建指向目录
domain.com/public_html/subdomain
的需要subdomain.domain.com
How do I do that?我该怎么做?
The subdomain
folder must be within the public_html
folder domain.com
subdomain
文件夹必须在public_html
文件夹domain.com
The vestaCP possesses the possilidade to choose the root folder of the subdomain
? VestaCP 拥有选择
subdomain
的根文件夹的可能性吗?
Sorry for my bad English.抱歉我的英语不好。
Simply put:简单地说:
I need it:我需要它:
sub.domain.com> /home/user/web/domain.com/public_html/subdomain
No:否:
sub.domain.com> /home/user/web/sub.domain.com/public_html
I always solve it by one of this 2 ways (each of them has advantages and disadvantages):我总是通过以下两种方式之一解决它(每种方式都有优点和缺点):
Redirect 301 / http://example.com/subfolder
to the .htaccess
file of subdomain.Redirect 301 / http://example.com/subfolder
添加到子域的.htaccess
文件中。 It's classic unmasked redirection./home/user/web/sub.domain.com/public_html
folder with this content: <?php print file_get_contents("https://example.com/subdomain/"); ?>
/home/user/web/sub.domain.com/public_html
文件夹中创建了一个包含以下内容的 PHP 文件 index.php: <?php print file_get_contents("https://example.com/subdomain/"); ?>
<?php print file_get_contents("https://example.com/subdomain/"); ?>
and in folder /home/user/web/example.com/public_html/subdomain
is website. <?php print file_get_contents("https://example.com/subdomain/"); ?>
文件夹中的/home/user/web/example.com/public_html/subdomain
是网站。 Phe PHP file displays the whole content of website on main domain folder. None of them is the real solution, it's just a how to hack it, but I hope it will be useful它们都不是真正的解决方案,只是如何破解它,但我希望它会有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.