Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Pointing a subdomain to a folder requires two separate settings. DNS sends the hostname, such as blog.example.com, to the server’s public IP address. The web server or hosting control panel then assigns that hostname a document root—the directory from which its files are served.

In cPanel, create the subdomain, turn off Share document root, and enter the target directory. On a server you manage with NGINX, match the hostname with server_name and set the directory with root. Changing only DNS cannot select a filesystem folder.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand the two layers before changing anything

A browser resolves a hostname before it requests a page. The process has two independent stages:

  1. DNS resolution: The authoritative DNS zone returns the server’s public IP address for the subdomain.
  2. Virtual-host selection: The web server receives the request containing the hostname and chooses a server block, virtual host, or hosting-account mapping. That configuration specifies the document-root directory.

DNS records contain hostnames and network destinations; they do not contain paths such as /home/user/public_html/blog. A DNS provider can send blog.example.com to the correct machine, but only the server configuration can decide which directory is opened for that request.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
Layer What you configure What a successful setting does Typical place to edit it
DNS An A record (or an appropriate alias) for the subdomain Resolves the hostname to the server’s public IP The authoritative DNS provider for the parent domain
Web server A hostname match and document-root path Serves files from the selected directory cPanel’s Domains interface, an NGINX server block, or another hosting panel
Application routing A proxy target such as an app process and port Forwards requests to an application instead of reading static files from a directory Hosting panel or web-server proxy configuration

These settings must agree. A correct directory mapping with an incorrect A record is unreachable, while a correct A record with no matching virtual host usually produces the default site, a 404, or a server error.

Check the prerequisites

Know which account owns the parent domain

You need access to the cPanel account or server configuration that controls the parent domain. Creating a subdomain in an unrelated hosting account does not change where the parent domain’s DNS points.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Identify the authoritative DNS provider

Look at the domain’s authoritative nameservers or the DNS service identified by your registrar. If DNS is hosted outside the cPanel server, the cPanel interface may not be able to create the public A record for you. The record must be added in the external authoritative zone.

Prepare the target directory

Choose a directory that is inside the account’s permitted filesystem area and decide whether it will contain static files or an application entry point. On a typical cPanel account, a path might be under /home/username/public_html/. The directory must exist, be readable by the web server, and contain an entry file such as index.html or the application’s configured entry point.

Plan HTTPS separately

The new hostname needs a certificate that covers the subdomain. A certificate for example.com is not automatically proof that blog.example.com is covered. Check whether your hosting service automatically provisions certificates or requires you to request one after the DNS record resolves.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Point a subdomain to a directory in cPanel

The current cPanel workflow uses the Domains interface. Labels can vary slightly by theme or hosting provider, but the important choice is to create a separate document root instead of sharing the parent domain’s root.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Sign in to cPanel for the account that owns the parent domain.
  2. Open Domains, then select Create A New Domain.
  3. Enter the fully qualified hostname, for example blog.example.com. Entering only blog is not equivalent on every cPanel version, so use the complete subdomain when the form requests a domain name.
  4. Clear Share document root (/home/username/public_html) with “domain.tld”. Sharing the root would make the subdomain serve the parent domain’s files rather than a separate directory.
  5. Enter the directory where the subdomain’s files should live. cPanel’s support procedure describes this as the directory where you want the files for the subdomain to exist.
  6. Submit the form and wait for cPanel to create the domain mapping.
  7. Place an index.html file or the application entry file in the selected directory.
  8. Create or verify the DNS record described in the next section, then test the exact hostname in a browser.

cPanel’s documentation describes a domain’s File System Location as its document root relative to the cPanel account’s home directory. The path displayed by the panel is therefore the location the web server uses for that domain; it is not a DNS value.

What the sharing checkbox changes

With Share document root enabled, the new hostname and the main domain use the same directory. That is useful when both names intentionally serve the same site, but it does not satisfy a request to isolate a subdomain in its own folder. Disable the option before submitting if the subdomain needs a distinct directory.

When cPanel reports that the hostname already exists

Search the Domains list for an existing domain, alias, redirect, or subdomain using the same hostname. Remove or edit the conflicting entry only after confirming that no live site depends on it. Two domain objects cannot reliably provide different document roots for the same hostname.

Create the DNS record

Create or verify an A record for the subdomain at the provider that is authoritative for the parent domain. Set the record’s name to the subdomain label (often blog, with the provider appending the parent domain) and its value to the public IP address of the server where the document root was configured.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
DNS item Use for this task Important qualification
A record Maps the subdomain to an IPv4 address Use the public address of the web server, not a private address from an internal network.
AAAA record Maps the subdomain to an IPv6 address when the server is reachable over IPv6 Only publish it if the IPv6 address leads to the same intended web configuration; an incorrect AAAA record can make some visitors bypass the working A record.
CNAME Aliases the subdomain to another hostname when your provider or architecture requires it The final hostname still has to resolve to the server or service that knows how to serve the requested subdomain. A CNAME does not select a directory.

If the hosting server manages DNS for the parent domain, the hosting panel may create the A record as part of the domain setup. If it does not manage DNS, add the record manually in the external zone. cPanel’s guidance for externally managed DNS makes the same distinction: the record must be added on the server that manages the root domain’s DNS.

Allow for caching without promising a fixed delay

Resolvers and browsers can retain old DNS answers until their cached TTL expires. There is no universal propagation time. The visible delay depends on the record’s previous TTL, the DNS provider, recursive resolvers, and local caches. During this period, one network may reach the new server while another still reaches the old destination.

Verify DNS before diagnosing the directory

Test the hostname from a resolver or network that is not relying on a stale local cache. The exact command varies by operating system, but a DNS lookup tool should show the intended public IP for blog.example.com. If it returns NXDOMAIN, no usable record exists in the authoritative zone. If it returns a different address, edit the authoritative zone rather than repeatedly changing the cPanel directory.

  • Confirm the spelling of the subdomain, including hyphens and dots.
  • Confirm that the lookup result is the public IP assigned to the web server.
  • Check both A and AAAA responses when IPv6 is enabled.
  • Check the authoritative nameservers so you know which DNS account to edit.
  • Retest after the relevant TTL has expired instead of assuming that an unchanged result means the server configuration failed.

DNS verification and HTTP verification answer different questions: a DNS lookup proves that the hostname reaches an address; an HTTP request proves that the server selected the intended virtual host and directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Point a subdomain to a directory with NGINX

On a server you administer directly, NGINX selects a configuration by comparing the request’s hostname with server_name. The root directive then defines the directory used to resolve static paths.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Illustrative server block for static files

The following is a minimal example. Adapt the listen directives, account path, TLS settings, logging, and include locations to the distribution and existing configuration. The example is for static files, not for proxying to an application process.

server {
    listen 80;
    server_name blog.example.com;

    root /home/user/public_html/blog;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}

NGINX documentation also shows the general pattern root /sites/$domain;, where the path is derived from the selected domain. Whether you use a fixed path or a variable-based layout, the directory must exist and the NGINX worker must be able to read it.

Apply and validate the configuration

  1. Save the server block in the configuration location used by your operating system or hosting image.
  2. Check the configuration syntax with the NGINX configuration-test command provided by your installation.
  3. Reload NGINX only after the syntax check succeeds.
  4. Confirm that the DNS record resolves to this machine.
  5. Request http://blog.example.com/ and verify that the response comes from the intended directory.

Do not use a reload to compensate for a DNS error. NGINX can be correctly configured while the hostname still resolves to another server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

NGINX customizations on cPanel

cPanel-managed NGINX installations use per-user and per-domain customization locations rather than treating the server as an unmanaged NGINX host. The documented pattern places a per-domain include under /etc/nginx/conf.d/users/username/domainname/. After creating the include, cPanel documents running /usr/local/cpanel/scripts/ea-nginx so the managed configuration can be regenerated or applied.

The exact include filename and directives depend on the existing cPanel-generated server block. Inspect that block and follow the hosting provider’s supported include mechanism; replacing the generated file directly can be overwritten by a later update. After applying a change, inspect the NGINX error log if the hostname returns an error or the service refuses to reload.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep static directory mapping separate from application proxying

A directory mapping and an application proxy are different serving modes. In static mode, NGINX or the hosting server reads a file below the document root and returns it. In proxy mode, the server forwards the request to an application listener, commonly identified by a local address and port, and returns the application’s response.

cPanel’s domain documentation states that a domain serves content either from a document root of files or as a proxy to a web app, not both at once. Choose the mode deliberately:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Requirement Use a document root when… Use an application proxy when…
Content The subdomain’s response is made of files in the target directory. Code must run on every request or generate dynamic responses.
Configuration You need a root path and, usually, an index file. You need a proxy target, process management, and application health checks.
Failure symptom Missing files commonly produce 404 or directory-permission errors. A stopped or misconfigured process commonly produces gateway errors.
Changeover Changing the directory changes the files served. Changing the proxy target changes the application receiving requests.

If a hosting panel asks whether to deploy an application, do not select that option merely because you want a separate folder. Select a static document root for files, or configure the application proxy intentionally and provide the app’s runtime details.

Compare hosting approaches before choosing one

Approach Separate document root DNS in the same account Server configuration access Best fit
cPanel hosting Available when the provider exposes the separate-root option in Domains. Depends on whether the server also hosts the authoritative DNS zone. Usually limited to supported panel and include mechanisms. Users who want a guided setup without editing the main web-server files.
Self-managed NGINX Fully configurable with server_name and root. Depends on the DNS service you operate or use. Direct access to server blocks, reloads, logs, and permissions. Administrators who need precise routing or many hostnames.
Application-oriented hosting May expose a directory, but often routes the hostname to an application instead. Varies by provider. Often limited to a platform-specific proxy setting. Apps that must execute code rather than serve a folder of static files.

Also verify that the service can issue an SSL certificate for the new hostname. A provider that lets you create a DNS record but does not permit a separate document root, certificate, or virtual-host mapping cannot complete this setup by DNS alone.

Troubleshoot by the symptom you see

Symptom Likely layer Checks and corrective action
NXDOMAIN or a DNS “name not found” message DNS Add the subdomain record in the authoritative zone. Confirm that you edited the provider named by the domain’s authoritative nameservers.
The hostname opens the old server DNS cache or wrong record Compare the lookup result with the intended public IP, inspect A and AAAA records, and wait for cached answers to expire according to their TTL.
The parent site appears instead of the subdomain’s files Virtual-host mapping Check that the subdomain was created with Share document root disabled, that the NGINX server_name is exact, and that no earlier virtual host is matching first.
A default server page appears Hostname selection Verify the request’s hostname, the active server block, and the DNS destination. A correct directory on a nonmatching server block will not be used.
403 Forbidden Filesystem access or directory index Confirm that the directory exists, the web-server user can traverse parent directories and read the files, and an allowed index file is present. Check the error log for the precise permission failure.
404 Not Found for a file that exists Root path or application routing Check the configured document root character by character, filename case, and any try_files, rewrite, or application rule that may be handling the request first.
HTTPS warning or certificate mismatch TLS Issue or install a certificate covering the exact subdomain, then confirm that the HTTPS virtual host uses the same hostname and intended directory or proxy.
NGINX reload fails after an edit Configuration syntax Run the installation’s configuration test, correct the reported directive or brace, and reload only after the test succeeds. Review the error log if the test passes but requests still fail.
cPanel changes appear to do nothing Managed configuration or DNS Confirm that the domain exists in cPanel, the authoritative DNS record points to that server, and any supported NGINX include was followed by the documented ea-nginx command.
The page is generated by an app instead of showing a file Proxy mode Inspect whether the domain is configured to proxy to an application. Switch to a document-root mapping only if the intended result is static-file serving.

Handle hostname variants deliberately

Non-www and www names are different hostnames

blog.example.com and www.blog.example.com are separate names. Include every name you intend to serve in DNS and in the web-server configuration, or create an explicit redirect from one to the other. Do not assume that a certificate, A record, or server_name entry for one automatically covers the other.

Wildcard subdomains need a different DNS decision

A wildcard record can send many otherwise undefined subdomains to one server, but it does not create individual directories or replace the hostname mapping on that server. cPanel notes that, when it does not manage the root domain’s DNS, wildcard-subdomain A records must be added manually in the external DNS zone. Use a wildcard only when the web-server configuration can safely determine how those hostnames should be handled.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Redirects can hide a correct directory

An existing redirect at the parent domain, an earlier virtual host, or an application rule may answer before the directory mapping. Test with the exact hostname and inspect response headers and server logs so you can distinguish a redirect from a missing file.

Use this final validation checklist

  • The subdomain is entered exactly as intended in the hosting panel or server_name.
  • The authoritative DNS zone contains an A record pointing to the server’s public IP, plus a correct AAAA record if IPv6 is used.
  • The cPanel domain does not share the parent document root, or the NGINX root points to the intended directory.
  • The target directory exists, is readable by the web server, and contains the expected entry file.
  • No other virtual host, redirect, alias, or application proxy is answering first.
  • HTTPS has a certificate covering the exact hostname.
  • After managed NGINX changes, the supported cPanel regeneration command has been run and the error log has been checked.
  • You tested the hostname after accounting for DNS caching rather than relying on a single network’s result.

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.