简体   繁体   English

在子域根目录上显示域文件夹的内容

[英]Display contents of domain folder on sub domain root

I have a website at root of main domain, let's call it domain(dot)com, this site runs a template based system through htaccess, similar to wordpress. 我在主域的根目录下有一个网站,我们称其为domain(dot)com,该站点通过htaccess运行基于模板的系统,类似于wordpress。 On there i have a section called domain(dot)com/forum/, the folder doesn't exist as it's managed through the template system and htaccess. 在那儿,我有一个名为domain(dot)com / forum /的部分,该文件夹不存在,因为它是通过模板系统和htaccess进行管理的。

I'm trying to find a solution where i create a subdomain on the same domain above and all works as if they are on domain(dot)com/forum/ but are in fact on forum(dot)domain(dot)com. 我正在尝试找到一种解决方案,其中我在上述同一域上创建了一个子域,并且所有子域都像在domain(dot)com / forum /上一样工作,但实际上是在forum(dot)domain(dot)com上。

Is this in fact possible as the htaccess file on the main site controls all the structure? 实际上这是否可行,因为主站点上的htaccess文件控制着所有结构?

I have searched everywhere from symlinks to vhosts document root but cannot find a solution to this. 我已经搜索了从符号链接到虚拟主机文档根目录的所有地方,但是找不到解决方案。

Any guidance will be greatly appreciated. 任何指导将不胜感激。

Thanks 谢谢

In the forum.domain.com public directory folder add a htaccess file and add the following: 在forum.domain.com公共目录文件夹中,添加htaccess文件并添加以下内容:

RewriteEngine On
RewriteRule ^(.*)$ domain.com/forum/$1 [NC,L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM