简体   繁体   中英

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. 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.

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.

Is this in fact possible as the htaccess file on the main site controls all the structure?

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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