What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Pointing a subdomain at a directory requires two separate settings: DNS sends the hostname to the right server, and the web server maps that hostname to a document-root directory. DNS cannot select a folder by itself. In cPanel, create the subdomain with Share document root disabled and enter the target directory. In NGINX, match the hostname with server_name and set the directory with root.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What “point a subdomain to a directory” actually means
Suppose you want blog.example.com to serve files stored in /home/user/public_html/blog. A browser first looks up blog.example.com in DNS. The DNS answer is normally an IP address, such as the public address of your hosting server. Once the request reaches that server, the web server examines the hostname and chooses a virtual-host or server-block configuration. That configuration sets the document root, the directory from which public files are served.
As an Amazon Associate I earn from qualifying purchases.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteThose layers have different jobs:
- DNS: maps the hostname to an IP address. It has no knowledge of your filesystem and cannot choose
/home/user/public_html/blog. - Web-server configuration: maps the hostname to a document-root directory and decides how requests are handled.
- Application configuration: may proxy requests to a running app instead of reading files from a directory. That is a different arrangement from static-file hosting.
A successful setup therefore needs both a DNS record and a matching server configuration. If either layer is missing, the subdomain may show a DNS error, the wrong website, a default page, or an application response from another virtual host.
Decide what the subdomain should serve
Static files from a directory
Use a document root when the subdomain should return files such as HTML, CSS, JavaScript, images, downloads, or a PHP application handled by the hosting stack. The directory must exist, be readable by the web server, and contain an entry file such as index.html or the entry point expected by your application.
#1 Best Overall
- DUAL-BAND WIFI 6 ROUTER: Wi-Fi 6(802.11ax) technology achieves faster speeds, greater capacity and reduced network congestion compared to the previous gen. All WiFi routers require a separate modem. Dual-Band WiFi routers do not support the 6 GHz band.
- AX1800: Enjoy smoother and more stable streaming, gaming, downloading with 1.8 Gbps total bandwidth (up to 1200 Mbps on 5 GHz and up to 574 Mbps on 2.4 GHz). Performance varies by conditions, distance to devices, and obstacles such as walls.
- CONNECT MORE DEVICES: Wi-Fi 6 technology communicates more data to more devices simultaneously using revolutionary OFDMA technology
- EXTENSIVE COVERAGE: Achieve the strong, reliable WiFi coverage with Archer AX1800 as it focuses signal strength to your devices far away using Beamforming technology, 4 high-gain antennas and an advanced front-end module (FEM) chipset
- OUR CYBERSECURITY COMMITMENT: TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.
A web application through a proxy
If the subdomain is meant to reach a Node, Python, Ruby, or other long-running application, the hosting panel may switch the domain into reverse-proxy mode. In that mode, requests are forwarded to the application process rather than served directly from a filesystem directory. cPanel’s documentation describes these as separate modes: a domain serves either its document root or a proxied web app, not both at once. Do not enter an application port where a document-root path is required, and do not expect a proxy target to behave like a folder.
Choose the path before creating the hostname
Use an absolute path that is inside the account’s permitted home directory. On cPanel, the domain’s file-system location is recorded relative to the cPanel account’s home directory. Decide whether you want a new, empty directory or an existing directory that already contains the site. Avoid pointing two unrelated sites at the same directory unless you deliberately want them to share every file, upload, and configuration.
cPanel: create a subdomain with its own document root
The labels below follow cPanel’s current Domains interface. cPanel Support’s procedure published April 11, 2026, specifically instructs users to deselect Share document root and then enter the directory where the subdomain’s files should exist.
Rank #2
- 𝐅𝐮𝐭𝐮𝐫𝐞-𝐑𝐞𝐚𝐝𝐲 𝐖𝐢-𝐅𝐢 𝟕 - Designed with the latest Wi-Fi 7 technology, featuring Multi-Link Operation (MLO), Multi-RUs, and 4K-QAM. Achieve optimized performance on latest WiFi 7 laptops and devices, like the iPhone 16 Pro, and Samsung Galaxy S24 Ultra.
- 𝟔-𝐒𝐭𝐫𝐞𝐚𝐦, 𝐃𝐮𝐚𝐥-𝐁𝐚𝐧𝐝 𝐖𝐢-𝐅𝐢 𝐰𝐢𝐭𝐡 𝟔.𝟓 𝐆𝐛𝐩𝐬 𝐓𝐨𝐭𝐚𝐥 𝐁𝐚𝐧𝐝𝐰𝐢𝐝𝐭𝐡 - Achieve full speeds of up to 5764 Mbps on the 5GHz band and 688 Mbps on the 2.4 GHz band with 6 streams. Enjoy seamless 4K/8K streaming, AR/VR gaming, and incredibly fast downloads/uploads.
- 𝐖𝐢𝐝𝐞 𝐂𝐨𝐯𝐞𝐫𝐚𝐠𝐞 𝐰𝐢𝐭𝐡 𝐒𝐭𝐫𝐨𝐧𝐠 𝐂𝐨𝐧𝐧𝐞𝐜𝐭𝐢𝐨𝐧 - Get up to 2,400 sq. ft. max coverage for up to 90 devices at a time. 6x high performance antennas and Beamforming technology, ensures reliable connections for remote workers, gamers, students, and more.
- 𝐔𝐥𝐭𝐫𝐚-𝐅𝐚𝐬𝐭 𝟐.𝟓 𝐆𝐛𝐩𝐬 𝐖𝐢𝐫𝐞𝐝 𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞 - 1x 2.5 Gbps WAN/LAN port, 1x 2.5 Gbps LAN port and 3x 1 Gbps LAN ports offer high-speed data transmissions.³ Integrate with a multi-gig modem for gigplus internet.
- 𝐎𝐮𝐫 𝐂𝐲𝐛𝐞𝐫𝐬𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐂𝐨𝐦𝐦𝐢𝐭𝐦𝐞𝐧𝐭 - TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.
- Sign in to the correct cPanel account. Use the account that owns the parent domain. If you manage several accounts, confirm that the parent domain is listed in this account before changing anything.
- Open the domain manager. In cPanel, open Domains, then choose Create A New Domain.
- Enter the fully qualified hostname. Type the complete subdomain, for example
blog.example.com. Do not enter onlyblogif the form expects a domain name. - Disable shared document root. Clear Share document root (/home/username/public_html) with “domain.tld”. Leaving this option enabled makes the subdomain use the parent domain’s document root, which defeats the purpose of a separate directory.
- Enter the target directory. In the file-system location field, enter the directory in which the subdomain’s files should live. Use the path format accepted by your account; cPanel records the location relative to the account home directory.
- Submit the form. cPanel creates the domain mapping and, where the account controls DNS, may create the corresponding DNS entry. The exact confirmation and automatically created folders depend on the host’s configuration.
- Place an entry file in the directory. Upload an
index.htmlfile or the application’s expected entry file. A correctly mapped but empty directory can otherwise produce a directory-index error or a blank/default response. - Test the exact hostname. Open
https://blog.example.comorhttp://blog.example.com, depending on whether TLS has already been configured. Test the subdomain, not just the parent domain, and check that the returned content is unique to the target directory.
What the cPanel fields control
| cPanel setting | Effect | Common mistake |
|---|---|---|
| New Domain | Creates the hostname that cPanel will recognize. | Entering an incomplete name or a different spelling from the DNS record. |
| Share document root | When enabled, the new hostname serves the parent domain’s existing root; when disabled, it can have its own location. | Leaving it enabled and assuming the directory field will still be used. |
| File System Location | Defines the directory relative to the cPanel account’s home directory, as described in cPanel & WHM documentation updated July 22, 2026. | Choosing a directory that does not exist, is outside the account’s permissions, or contains the wrong site. |
Set the DNS record at the authoritative provider
After the server-side mapping exists, create or verify an A record for the subdomain at the DNS provider authoritative for example.com. Set the record’s value to the public IP address of the server where the document root was configured. A typical record is conceptually:
| Name | Type | Value | Purpose |
|---|---|---|---|
blog or blog.example.com, according to the provider’s form |
A | Your hosting server’s public IPv4 address | Sends requests for the subdomain to the server that contains the virtual-host mapping. |
Use the provider’s exact name format. Some DNS dashboards append the parent domain automatically when you enter blog; others expect the full hostname. Entering blog.example.com.example.com is a common error in dashboards that append the zone name.
When DNS is managed outside cPanel
If your hosting server does not manage the parent domain’s DNS, adding the subdomain only in cPanel is insufficient. Edit the DNS zone at the external authoritative provider and add the A record there. cPanel’s support documentation makes the same distinction for wildcard subdomains: when cPanel does not manage the root domain’s DNS, the record must be added manually on the server that manages that zone.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Rank #3
- Next-Gen Gigabit Wi-Fi 6 Speeds: 2402 Mbps on 5 GHz and 574 Mbps on 2.4 GHz bands ensure smoother streaming and faster downloads; support VPN server and VPN client¹
- A More Responsive Experience: Enjoy smooth gaming, video streaming, and live feeds simultaneously. OFDMA makes your Wi-Fi stronger by allowing multiple clients to share one band at the same time, cutting latency and jitter.²
- Expanded Wi-Fi Coverage: 4 high-gain external antennas and Beamforming technology combine to extend strong, reliable, Wi-Fi throughout your home.
- Improved Battery Life: Target Wake Time helps your devices to communicate efficiently while consuming less power.
- Improved Cooling Design: No heat ups, no throttles. A larger heat sink and redefined case design cools the WiFi 6 system and enables your network to stay at top speeds in more versatile environments.
Allow for caching without promising a fixed time
Resolvers cache DNS answers according to the record’s TTL and their own policies. A newly added or changed record can therefore remain invisible to some networks while others already use the new address. There is no universal propagation time. Verify the authoritative record first, then allow provider- and TTL-dependent caching to expire before treating an intermittent result as a server configuration failure.
NGINX: map the hostname with a server block
When you control NGINX directly, the essential configuration is a server block that matches the requested hostname and sets the document root. NGINX’s documentation demonstrates the pattern with a root directive such as root /sites/$domain;. A concrete static-site block can look like this:
server {
listen 80;
server_name blog.example.com;
root /home/user/public_html/blog;
index index.html;
}
The example shows the relationship, not a complete production configuration. Your existing setup may require a different listener, TLS settings, PHP handler, access rules, or an application front controller. Keep the exact hostname in server_name; a typo or an unintended wildcard can cause another server block to answer first.
Rank #4
- Dual band router upgrades to 1200 Mbps high speed internet (300mbps for 2.4GHz plus 900Mbps for 5GHz), reducing buffering and ideal for 4K stream
- Full Gigabit Ports - Gigabit Router with 4 Gigabit LAN ports, ideal for any internet plan and allow you to directly connect your wired devices
- Boosted Coverage - Four external antennas equipped with Beamforming technology extend and concentrate the Wi-Fi signals
- MU-MIMO technology - (5GHz band) allows high speeds for multiple devices simultaneously
- Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home
Apply the NGINX change safely
- Create or edit the server configuration used by the account or domain.
- Set
server_nameto the exact subdomain, such asblog.example.com. Add awwwname only if you have separately created and intend to serve that hostname. - Set
rootto the directory containing the public files. Confirm the directory exists and is readable by the NGINX worker process. - Set an appropriate
indexdirective or application routing rule. - Validate the configuration with the validation command provided by your operating system or hosting provider before reloading NGINX.
- Reload NGINX using your provider’s documented method, then request the hostname again.
NGINX on cPanel
On cPanel installations that use NGINX, per-domain customizations are stored under a user/domain include path such as /etc/nginx/conf.d/users/username/domainname/. The exact include filename and directives depend on the existing server block and the application. After creating the documented include, cPanel’s procedure requires running /usr/local/cpanel/scripts/ea-nginx so the generated NGINX configuration incorporates the change. Do not edit a generated file that your control panel will overwrite; use the supported per-user or per-domain include location instead.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Keep static hosting and proxying separate
A directory mapping answers the question, “Which files should this hostname serve?” A reverse proxy answers, “Which running service should receive this request?” They can coexist on one server, but a single domain configuration must have a clear primary mode.
- For a static site, the request should resolve to a document root and an entry file.
- For a proxied app, the configuration should forward requests to the application process and port defined by the hosting platform.
- If a panel reports that the domain is configured for an application, changing a folder alone will not make the app serve static files from that folder.
- If an old proxy, redirect, or virtual host still matches first, the browser may never reach the directory mapping you created.
HTTPS and hostname coverage
DNS and document-root settings do not automatically prove that HTTPS is ready. The certificate presented for blog.example.com must cover that exact hostname. Check the hosting panel’s SSL status after creating the subdomain, and make sure the certificate issuance or renewal process includes the new name. Test the HTTPS URL directly; a certificate for only example.com does not necessarily cover blog.example.com.
Verify each layer in order
Testing in sequence prevents you from debugging the wrong layer.
- Check the authoritative DNS answer. Query the A record with a DNS diagnostic tool such as
dig +short blog.example.comor use the provider’s record viewer. The returned address should be the public IP of the intended server. - Check the server mapping. Confirm that the hostname appears exactly in the cPanel domain list or NGINX
server_nameconfiguration and that the document root is the intended directory. - Check the filesystem. Confirm the directory exists, the web-server user can traverse it, and the expected entry file is present with readable permissions.
- Check the response. Request the hostname with a browser or
curl -I https://blog.example.com. A response from the wrong site usually indicates a hostname mismatch, an earlier virtual host, or a proxy/redirect. - Check logs. If the request reaches the server but fails, inspect the relevant NGINX, Apache, or hosting-panel error log for permission errors, missing files, redirect loops, or upstream failures.
Troubleshooting by symptom
| What you see | Likely cause | What to check next |
|---|---|---|
| DNS name does not resolve | No A record, a record at the wrong DNS provider, or cached old data. | Identify the authoritative provider, verify the A record and IP, and account for TTL-based caching. |
| Parent website appears | The subdomain shares the parent document root or the request matched the parent virtual host. | In cPanel, disable Share document root; in NGINX, verify the exact server_name and server-block order. |
| Default NGINX or hosting page appears | The hostname reached the server but no matching configuration was loaded. | Check spelling, include-file placement, configuration generation, and reload status. |
| 404 for the home page | The mapped directory lacks the configured index file, or application routing is incomplete. | Place the expected entry file in the directory and check the index or front-controller setting. |
| 403 Forbidden | The directory or file is not readable, directory traversal permissions are missing, or access rules deny the request. | Check ownership, permissions, parent-directory traversal, and server access directives. |
| Old content appears after a change | A resolver, browser, CDN, or server-side cache still holds the previous result. | Confirm the authoritative DNS answer and server configuration before clearing local caches or waiting for TTL expiry. |
| HTTPS warning | The certificate does not include the new subdomain or the HTTPS virtual host is not mapped to the same content. | Issue or renew a certificate covering the exact hostname and inspect the TLS server block. |
| Application response instead of files | The domain is configured for proxying rather than static document-root serving. | Choose the intended mode and remove or adjust the conflicting proxy configuration through the hosting panel or server configuration. |
Compare hosting approaches before you commit
The easiest method depends on what your provider lets you control. Evaluate the following capabilities rather than assuming every plan exposes the same settings.
Recommended Free Tools
Quick Recap
| Capability | Why it matters | Question to ask the provider |
|---|---|---|
| Separate document roots | Without this, a subdomain may be forced to use the parent site’s directory. | Can each subdomain have an independent file-system location? |
| DNS management in the same account | One account can make the DNS and server changes easier to coordinate. | Does the control panel manage the authoritative zone, or must I edit DNS elsewhere? |
| Web-server configuration access | Direct NGINX or Apache access is useful when the panel cannot express a custom mapping. | Can I add a supported per-domain configuration or include? |
| Clear static-versus-proxy controls | Confusing a proxy target with a directory is a frequent source of wrong responses. | Can the domain be explicitly configured for static files or for an application proxy? |
| SSL coverage | The hostname may work over HTTP while HTTPS fails or serves a different virtual host. | Will certificates include newly created subdomains, and how are they renewed? |
Operational and security checks
- Keep the document root limited to files that are intended to be public. Store secrets, backups, and deployment credentials outside it.
- Use the least permissive ownership and file permissions that still allow the web server to read the site and the deployment process to update it.
- Do not place a control-panel configuration file, environment file, private key, or database dump in a publicly served directory.
- Record which DNS provider is authoritative and which server configuration owns the hostname. This makes later migrations and incident response faster.
- After changing the mapping, test both the bare subdomain and any intentionally configured alternate hostname. A record for
blog.example.comdoes not automatically configurewww.blog.example.com. - When removing a subdomain, delete or disable its DNS record and server mapping deliberately. Leaving one layer active can expose an unintended default site or create confusing errors.
Quick decision guide
- If you use cPanel and only need a normal folder, create the domain in Domains, clear Share document root, enter the directory, and place the entry file there.
- If DNS is hosted elsewhere, add the subdomain’s A record at that authoritative provider and point it to the server’s public IP.
- If you administer NGINX, create a hostname-matching server block and set its
rootto the target directory, then validate and reload the configuration. - If the site is a running application, configure the hosting platform’s proxy mode instead of treating its port as a filesystem path.
- If the result is wrong, check DNS, hostname matching, directory existence and permissions, competing virtual hosts, proxy settings, and SSL coverage in that order.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




