Contents
- 1 How do I change the root directory of my website?
- 2 What is a root directory of a website?
- 3 How do I reference a file in another directory in HTML?
- 4 When to use a different document root directory?
- 5 How to pick root folder from sub folders?
- 6 How to change the document root directory for an addon domain?
How do I change the root directory of my website?
To change the document root folder:
- Log in to cPanel.
- In the Domains section, click the Addon Domains or Subdomains icon, depending on which you’d like to modify.
- Locate the addon domain (or subdomain) you wish to modify.
- Click the pencil icon next to the current document root for the domain you wish to modify.
What is a root directory of a website?
The root directory of your website holds the content that loads when visitors type your domain name in a browser. For example, you need to put your index file in your website’s root directory for visitors to see your site. Website-related applications might also need to know your website’s root directory.
How do I reference a file in another directory in HTML?
To link to a target file in the same directory as the invoking HTML file, just use the filename, e.g. my-image. jpg . To reference a file in a subdirectory, write the directory name in front of the path, plus a forward slash, e.g. subdirectory/my-image.
How do you reference a file in HTML?
An HTML file path is used to describe the location of a file in a website folder. File paths are like an address of file for a web browser….Example:
-
Using a Full URL File Path
When to use a different document root directory?
However, sometimes you may want to use a different directory as the document root. This is often the case, for example, if you want to try out a new application or test a website configuration before it goes live.
How to pick root folder from sub folders?
If you know the location relative to the root of the server, that may be simplest approach for an app with a complex nested directory hierarchy – it would be the same from all folders. For example, if your directory tree depicted in your question is relative to the root of the server, then index.html and sub_folder/sub.html would both use:
How to change the document root directory for an addon domain?
The second method uses .htaccess redirection, and can be configured in cPanel. If you want to change the document root directory for an addon domain, do not follow the procedures below. Instead, use cPanel to change the addon domain’s document root directory.
Where is the root directory of a shared server?
By default, your account’s document root directory on a shared server is the /home/username/public_html directory, where username represents your A2 Hosting account username.