Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
VGSources
Blog

How to Point a Domain to a Subfolder of Your Website

DNS cannot include a URL path. This guide shows how to map a domain’s document root to an existing subfolder, create a full-URL redirect, or configure reverse-proxy routing—with cPanel, Cloudflare, HTTPS, and troubleshooting guidance.
Length12 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DNS cannot point a hostname to a URL path such as /subfolder. DNS can direct the domain to the server or proxy that receives the request; your hosting or web-server configuration must then decide what content to serve. To keep the new domain visible in the browser while showing an existing directory, add the domain to your hosting account and set that domain’s document root to the subfolder. To send visitors to a complete address such as https://example.com/subfolder, configure an HTTP redirect instead.

What “point a domain to a subfolder” actually means

A domain name and a URL path are handled by different layers. A DNS lookup answers “which server or proxy should receive this hostname?” It does not carry the slash and folder name in a URL. The path is interpreted only after an HTTP or HTTPS request reaches a web server, reverse proxy, or application.

As an Amazon Associate I earn from qualifying purchases.

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

For example, suppose your existing site is available at https://example.com/subfolder and you register newdomain.example. There are three materially different outcomes:

Approach What the visitor sees Where the content is selected Best fit
Document-root mapping https://newdomain.example/ The hosting account or virtual-host configuration assigns the subfolder as the domain’s document root. The subfolder should behave as an independent site under the new hostname.
HTTP redirect The browser changes to https://example.com/subfolder (or another full target URL). The registrar, hosting panel, or proxy returns a redirect response. You want one canonical address and do not need the new domain to serve content itself.
Reverse proxy or application routing Usually the new hostname remains in the address bar. A front server routes that host to an upstream application or equivalent subfolder. The content is on another service, container, application, or origin.

Choosing the wrong method is the usual cause of a “DNS does not work” result: the record may resolve correctly while the web server still has no domain, no document root, or no route for the request.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Choose the method before changing DNS

Use a document root when the URL should stay on the new domain

With this arrangement, the new hostname is added to the hosting account or web-server configuration, and its document root is set to the existing subdirectory. A request for the root of the new domain is then read from that directory. The original domain and path can remain in place if you need both addresses.

This is not automatically the same as moving an application. The application must tolerate a different hostname and, in some cases, a different base URL. Check generated links, cookie scope, canonical tags, rewrite rules, sitemap URLs, and any framework base-path setting after the mapping.

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

Use a redirect when the destination URL should be visible

A redirect tells the client to request another URL. The address bar changes, and the target site handles the page. A permanent redirect is appropriate only when the move is intended to be durable; use the provider’s temporary option while testing or when the arrangement may change.

Use a reverse proxy when the origin or application is separate

A reverse proxy accepts the new hostname at a front server and forwards requests to an upstream service. The proxy must be configured for the host, path handling, HTTPS, and response headers. This is more flexible than a simple document-root assignment, but it requires server or application administration.

Prepare the domain, hosting account, and application

  • Confirm ownership and access. You need access to the DNS provider and to the hosting, proxy, or web-server configuration that will receive requests.
  • Identify the exact subfolder. Use the directory that already contains the intended public files or application entry point. A document root is the directory from which the domain’s web server serves publicly available files.
  • Decide which hostnames are in scope. Decide whether the apex name, such as newdomain.example, the www name, or both should work. Select one canonical hostname and plan a consistent redirect for the other.
  • Inventory DNS services. Web records can be hosted in one place while mail, verification, or other records remain with another provider. Do not replace unrelated records when adding the web record.
  • Plan TLS. Decide whether the origin server or a proxy will terminate HTTPS. If traffic goes directly to the origin, the origin needs a certificate covering the hostname visitors enter.
  • Check application assumptions. Look for hard-coded absolute URLs, cookie domains, canonical links, rewrite rules, sitemap entries, OAuth callback URLs, and framework settings that assume the old host or path.

Method 1: map the new domain to the existing subfolder

Generic hosting-panel procedure

  1. Open your hosting control panel’s domain-management area. The control may be called Add-on Domain, Domain Alias, Additional Domain, or Virtual Host.
  2. Add the new domain as a domain that the account will serve. Do not stop at creating a DNS record; the hosting account must also know that this hostname is valid.
  3. When the panel asks for a document root, replace the automatically suggested directory with the existing subfolder. Use the panel’s path format and verify that the folder is inside the account’s publicly served area.
  4. Save the domain configuration and confirm that the panel shows the intended document-root path. If the host creates a new empty directory automatically, edit the domain and point it to the existing directory instead of copying files unnecessarily.
  5. In the DNS provider, create the record that directs the hostname to the hosting endpoint. Use an A record for an IPv4 address, an AAAA record for IPv6, or a CNAME when the host supplies another hostname.
  6. Issue or attach a TLS certificate for every hostname you intend to serve over HTTPS. The certificate must cover the name in the browser’s address bar.
  7. Request the new hostname over both HTTP and HTTPS, then test internal links, forms, logins, images, scripts, cookies, canonical tags, and the sitemap from the new origin.

cPanel describes the underlying behavior this way: “By default, a domain’s web server … returns files from the domain’s directory (the document root).” Its domain-management interface therefore matters as much as the DNS record. A record that points at the server without a domain entry can still produce an unknown-host, default-site, or certificate error.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Application checks after the mapping

Serving the same files under a second hostname can expose assumptions that were invisible at the old address. Verify that redirects do not send every request back to the old domain, that cookies are accepted on the new host, and that URL generation does not prepend the old hostname. If the software has a configurable site URL or base URL, set it deliberately rather than relying on an automatic guess.

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

Review canonical tags and sitemap URLs with your intended indexing strategy. If the new domain is only an alternate access point, you may want canonical URLs to remain on the original site. If it is replacing the old address, update the application’s canonical and sitemap settings as part of the migration.

Method 2: forward the domain to a full URL

Hosting or registrar forwarding

  1. Open the provider’s URL Redirect, Domain Forwarding, or similarly named tool.
  2. Enter the complete destination, including the scheme and path, for example https://example.com/subfolder. A bare hostname is not a substitute for the intended path.
  3. Select a temporary redirect while you are testing or while the destination may change. Select a permanent redirect only after you have decided that the source domain should consistently send visitors to that URL.
  4. Save the rule and make sure the source domain’s DNS points to the forwarding service or the provider’s specified forwarder. cPanel notes that forwarding domains need their A record pointed at the forwarder IP.
  5. Test the apex and www forms separately if both are configured. Confirm that the browser lands at the exact target URL and that HTTPS is handled for the source hostname as well as the destination.

Forwarding is appropriate when the new domain is an alias, campaign address, or retired-site address. It does not make the subfolder a separate application under the new host; the destination server remains responsible for the page.

Cloudflare redirect workflow

Cloudflare separates DNS resolution, proxying, and redirect processing. Add the domain’s DNS record, choose the proxy status intentionally, and create a redirect rule that targets the full URL. Cloudflare’s alias-domain redirect documentation requires a DNS record that resolves through the proxy before the redirect is applied.

If the record is not proxied and traffic goes directly to your origin, the origin is responsible for SSL/TLS on the source hostname. If Cloudflare terminates TLS at the edge, configure the origin and encryption mode to match your security requirements and ensure the origin can serve the request Cloudflare forwards.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Method 3: route the hostname through a reverse proxy or application

Choose this method when the subfolder-equivalent content lives on another origin, port, service, or application. DNS still points the hostname at the front server; the front server then matches the Host header and routes the request upstream.

  1. Create the DNS A, AAAA, or CNAME record for the front server or proxy endpoint.
  2. Declare the new hostname in the proxy or application’s virtual-host configuration.
  3. Define the upstream service and decide whether the incoming path should be preserved, rewritten, or translated to an application route.
  4. Configure HTTPS termination. If the proxy handles TLS, install a certificate there and establish an appropriate encrypted connection to the origin when required.
  5. Forward the original host and protocol information in the manner expected by the application, so generated links, redirects, and secure-cookie decisions use the public hostname.
  6. Test status codes, redirects, uploads, WebSockets or other special protocols used by the application, and error pages through the new host.

A reverse proxy is not a DNS feature. It is a server-level routing design, so the exact controls and syntax depend on the proxy software and hosting environment.

DNS and HTTPS details that commonly decide success

Choose the correct record type

Record Use it when Important limitation
A Your web endpoint has an IPv4 address. It does not identify a URL path or configure the web server.
AAAA Your endpoint has an IPv6 address. The IPv6 service must be configured to serve the same hostname and content.
CNAME Your provider gives you a hostname instead of an address. Use the target hostname exactly as supplied; the receiving service still must recognize your domain.

Cloudflare summarizes the division of responsibility as follows: “While DNS is what communicates where your website or application can be reached, SSL/TLS is what enables websites and applications to establish connections in a secure way.” A successful DNS answer therefore does not prove that HTTPS, a certificate, or a document root is ready.

Cover every intended hostname

Configure and test the exact names people may enter. If both the apex and www should work, give each an intentional DNS and hosting configuration, then redirect one to the canonical choice. Check that the certificate includes each name during the transition.

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

Keep non-web records intact

Adding a web record should not remove MX records for mail, TXT records used for verification, or other services. If DNS remains with a separate provider, make the web change there and leave the other records untouched.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

cPanel and WHM: where to look

In cPanel or WHM, use the domain-management interface to add the domain and assign its document root when the new hostname should serve the subfolder directly. Use the forwarding interface when the desired result is a redirect to a complete URL. The labels and available options vary by account permissions and host configuration.

After saving a document-root mapping, inspect the displayed path and confirm that the folder contains the expected index file or application entry point. After saving a forward, verify the source domain’s A record points to the forwarder IP specified by the provider. In either case, complete the DNS and certificate steps separately; creating the domain object alone does not make public DNS resolve.

Cloudflare: separate DNS, proxy, and redirect decisions

  1. Add the domain or hostname in the appropriate zone and create the A, AAAA, or CNAME record for the endpoint.
  2. Choose whether the record is proxied. Proxied traffic can be processed by Cloudflare redirect rules; DNS-only traffic goes directly to the origin.
  3. For forwarding, create a redirect rule whose target is the complete destination URL, including the path.
  4. For document-root mapping, leave the redirect out and configure the origin host or virtual host to serve the chosen directory.
  5. Issue certificates and test both the edge connection and the origin connection according to the selected proxy mode.

Cloudflare’s controls change over time, so use the labels currently shown in your account. The essential distinction remains the same: a DNS record selects an endpoint, while the origin or redirect rule selects content and path behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to verify the result without guessing

  • Check DNS resolution. Confirm that the hostname returns the intended A, AAAA, or CNAME target, not an old address or an unrelated default.
  • Check the response host. Open the domain directly and verify that the page is from the intended subfolder, not the account’s default site.
  • Check the address bar. A document-root mapping should retain the new hostname; a redirect should end at the configured full URL.
  • Check HTTPS. Visit the HTTPS form and confirm that the certificate matches the entered hostname and that there is no mixed-content failure.
  • Check both canonical variants. Test the apex and www names, plus HTTP-to-HTTPS behavior, if those variants are enabled.
  • Check application behavior. Follow navigation, submit a form, sign in, load images and scripts, set a cookie, and inspect redirects. These tests reveal hard-coded host, path, and cookie settings.
  • Check indexing signals. Inspect canonical tags and sitemap URLs to ensure they point to the host you actually want search engines to treat as primary.

Troubleshooting by symptom

The domain shows “site not found” or a default page

The DNS record may be correct while the domain is missing from the hosting account or virtual-host configuration. Add the domain there and assign the intended document root. Also check for a misspelled hostname, an incorrect record target, or a proxy route that does not match the incoming host.

The browser redirects to the wrong place

Inspect every active redirect at the registrar, hosting panel, proxy, and application layers. Remove conflicting rules and decide whether the source should redirect permanently or temporarily. An application-level canonical redirect can override an otherwise correct forwarding rule.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

HTTPS warns about the certificate

Install or issue a certificate containing the hostname visitors use. If a proxy terminates TLS, check the proxy certificate and its connection to the origin separately. If the record is DNS-only, the origin must serve the certificate itself.

Pages load but links, images, or logins fail

Inspect generated absolute URLs, relative-path assumptions, cookie domains, rewrite rules, and framework base-path settings. Correct those values for the new hostname or intentionally retain the original canonical host.

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

The new domain works, but email stopped

Review the zone for deleted or replaced MX and TXT records. Web hosting and mail hosting can be separate; adding the web endpoint should not require moving mail records.

Decision checklist

  • Keep the new hostname visible: choose document-root mapping or reverse-proxy routing.
  • Show the existing full address: choose an HTTP redirect.
  • Same hosting account and ordinary files: assign the existing subfolder as the document root.
  • Separate origin or application: configure a reverse proxy and explicit host and HTTPS handling.
  • Any method: add the domain to the receiving service, create the appropriate DNS record, issue TLS, and test the application and canonical hostname.

What DNS can and cannot do

DNS can direct newdomain.example to an IPv4 address, IPv6 address, or provider hostname. It cannot express “serve /subfolder” or perform an HTTP redirect by itself. The folder mapping, redirect, or upstream route must exist on the service that receives the request. Once those layers are configured deliberately, pointing a domain at existing content is a predictable hosting task rather than a DNS trick.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.