• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How DO I Set Root Directory For Subdomain?

S

Superman859

Guest
How Do I Mod_Rewrite For Subdomain?

I'm switching servers. The old server used a different file structure and had a generic control panel. The structure was something like

public_html/folders

where folders could be whatever. For a subdomain, you could create a subdomain and then specify the root directory. For example, I have www.site.com/phpBB2 as a directory for forums. I created forums.site.com and set the root as public_html/phpBB2.

Now, I'm moving the site to Plesk. My code is all written for the old file structure. With Plesk, subdomains by default end up in subdomains/subname/httpdocs.

If I were to take all the files from phpBB2 and simply put them in subdomains/forums/httpdocs, I'd have some issues with my php code.

What I would like to do is still use forums.site.com, but get that to point to httpdocs/phpBB2 rather than subdomains/forums/httpdocs. If I can do that, then I should be able to transfer everything with ease and not worry about breaking the code.

Any ideas?

Edit: I've been searching around and it seems like the best option is with a mod_rewrite. I'm not too familiar with those, so it's difficult to write one on my own from looking at other examples.

An example for one subdomain (say forums.site.com pointing to httpdocs/phpBB2 ) should be enough to allow me to create my own vhost.conf file for the other subdomains. By the way, I can just create vhost.conf if it's not present, right? All I have in conf/ is httpd.include which I'm not supposed to edit.
 
Back
Top