how to edit document root of subdomain in bluehost CPanel
Asked Answered
M

4

5

Hope someone could help, am new to bluehost and had a shared hosting subscription. Now my issue is how to modify the subdomain document root.

example: from public_html/sub to public_html/sub/public

also when i created a subdomain it doesn't even allow me to add "/" unlike in godaddy

thanks.

Mesh answered 23/3, 2022 at 15:46 Comment(3)
This is not about programming. -1 – Wolf
well its true, the thing is I couldn't find any other options other than the answer i posted – Mesh
The answer may be correct and useful, but that doesn't change the fact that the question is off-topic here to begin with, as this is a programming forum and the question has nothing to do with programming. – Wolf
C
6

I had the same issue, some how I landed to this URL https://my.bluehost.com/cgi/dm/subdomain and it allowed to to add "/" with subdomain, hope it helps

enter image description here

Calla answered 21/5, 2022 at 22:24 Comment(2)
So the old interface is better than the new one. Thanks I did not want to have to talk to chat again πŸ˜… – Fancy
Good lord, this worked for me too. What a find... – Expend
C
2

Changing the document root in cPanel worked for me, so it might be worth a try.

  1. Go into the settings for the site you want to change in the Websites area, then click Advanced at the top.
  2. From there, click "Manage" under cPanel, then choose the "Domains" link (or just search for "Domains").
  3. Click "Manage" to the right of the domain (or subdomain) you want to change, and there will be a spot to update the document root on that page.

Best of luck!

Cussedness answered 8/3 at 21:6 Comment(0)
M
0

I found a solution so on the root folder add or edit if already existing .htaccess

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.domain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.sub.domain.com$
RewriteCond %{REQUEST_URI} !sub/public/
RewriteRule (.*) /sub/public/$1 [L]

Done

Mesh answered 23/3, 2022 at 17:33 Comment(0)
T
0

In order to do this via the Bluehost interface, I followed these steps:

  1. Go to 'My Domains' under 'Domains' in the left-hand column
  2. Click the 'Manage' drop down and choose 'Unassign'
  3. Click the green box that says 'Unassign'
  4. Go to 'Assign' under 'Domains' in the left-hand column
  5. Go to 'Subdomains' under 'Domains' in the left-hand column (If you don't click 'Assign first, then clicking 'Subdomains' takes you to a different page...)
  6. Under the 'Existing Subdomains' header, find the subdomain with the Document Root you want to change and click the red trash can under 'Actions'
  7. Now you can re-assign your domain as an addon or whatever and give it a new Document Root. (I should note, that none of these steps deleted my document root directory).
  8. Go to 'Assign' under 'Domains' in the left-hand column
  9. Follow the steps to assign an existing domain
Tumefy answered 22/11, 2022 at 13:4 Comment(1)
I should mention that because I had to create a new account on Stack Overflow, I am a newbie again and can't post screenshots in my post, otherwise I would have done so. :) – Tumefy

© 2022 - 2024 β€” McMap. All rights reserved.