• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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