Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › 301 redirects

How to Redirect a Blog Subdomain to Your Main Domain

By Freedom251 Team · · 13 min read

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

To redirect blog.example.com to example.com, keep a DNS record for the subdomain, make sure the old hostname has a valid HTTPS certificate, and configure an HTTP 301 or 308 redirect at a CDN, web server, or hosting panel. DNS only points the hostname to infrastructure; the HTTP layer sends the redirect and can preserve each article’s path and query string.

How the redirect actually works

A subdomain move has two separate layers. Understanding them prevents the most common failed setup: adding a DNS record and expecting browsers to jump to another URL.

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.

DNS points the old hostname to a responder

Create or retain an A, AAAA, or CNAME record for blog. The record makes blog.example.com resolve to a CDN, reverse proxy, hosting account, or origin server that can receive the request. DNS does not return an HTTP status code and cannot, by itself, tell a browser to use example.com.

Can DNS alone redirect a subdomain?

No. DNS can point the subdomain at a service, but only that service can answer the browser’s HTTP or HTTPS request with a Location header. Some DNS providers expose a redirect feature, but that feature is an HTTP redirect running at the provider’s edge, not a special DNS record. If you use a DNS-only record, the origin server must be configured to issue the response.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

HTTP returns the redirect

After DNS resolution, the browser connects to the service and requests a URL such as https://blog.example.com/guides/setup?source=newsletter. Your redirect rule must return a permanent server-side status, normally 301 or 308, with a Location header pointing to the equivalent URL on the main domain. Search engines treat 301 and 308 as permanent redirects and Google recommends a permanent server-side redirect when a page URL has changed.

A 301 is the usual choice for a normal blog move. A 308 is also permanent and is useful when preserving the original request method is important. A temporary 302 is appropriate only for a genuinely temporary condition, not for a migration intended to last.

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

Why HTTPS must be ready first

An HTTPS request cannot reach your redirect rule if the old hostname presents an invalid or missing certificate. The certificate must cover blog.example.com even though the final destination is on another hostname. With a proxied first-level subdomain at Cloudflare, Universal SSL can cover the old hostname; with DNS-only service, the origin must serve TLS itself.

Plan the URL mapping before touching DNS

A redirect is most useful when every old URL has a relevant destination. Export the blog’s live article URLs, feeds, important assets, and significant query-string variants. Then decide whether each address moves to the same path, a new folder, or a manually selected replacement.

Keep equivalent paths where possible

Old URL New URL Mapping
https://blog.example.com/guides/setup https://example.com/guides/setup Same path on the main host
https://blog.example.com/guides/setup https://example.com/blog/guides/setup Subdomain moved into a folder
https://blog.example.com/old-title https://example.com/new-title Explicit one-to-one article mapping

Do not send every unrelated article to the homepage. Google advises mapping old URLs to relevant new URLs; a homepage fallback is appropriate only when it is genuinely the best destination for that request. Keep feeds and other important endpoints mapped as well as HTML articles.

Include redirects for image, stylesheet, feed, and other URLs that users or subscribers still request from the old host. An HTML page may load at the new domain while its feed or asset URLs continue to fail if those paths were omitted from the map.

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

Decide what happens to query strings

Campaign parameters, search parameters, and other tracking values may need to survive the move. A request for /guides/setup should normally arrive at the mapped path with its query string intact, unless your analytics or privacy policy requires deliberate removal. Check the redirect product’s “preserve query string” behavior rather than assuming it.

Test both a clean URL and one with multiple parameters. Make sure the rule does not append the query string twice, accidentally discard it, or create a destination with an invalid combination of encoded characters.

Prerequisites and a safe change plan

  • Access to the DNS zone for example.com.
  • Access to the CDN, origin server, or hosting control panel that will issue the response.
  • A valid certificate for the old HTTPS hostname and the final main-domain hostname.
  • An export of old URLs and a destination map.
  • A way to inspect response headers before launch.
  1. Keep the old DNS record active; do not delete it when you add the redirect.
  2. Build and test the redirect rule on a representative set of URLs.
  3. Update site signals after the rule works: internal links, XML sitemaps, canonical tags, structured-data URLs, feeds, and analytics settings.
  4. Leave the old hostname redirecting while users and crawlers discover the new addresses.

Prepare a rollback and ownership checklist

Record which system owns each layer before making the change: the DNS provider, the certificate issuer or CDN, and the origin or hosting panel. This makes it clear where to look when a request fails. Keep a copy of the old rule and the URL map so you can correct a bad destination without guessing. If several systems can redirect the same hostname, document their order; a CDN rule may run before the origin, while an application rule may run after it.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Method 1: Redirect at a CDN or DNS provider

An edge redirect is convenient when the provider manages your DNS and can answer requests before they reach the origin. Cloudflare’s documented pattern uses a proxied DNS record and a Single Redirect rule.

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

Cloudflare setup

  1. In the DNS settings, create or retain an A record for blog. Point it to an appropriate address and enable the provider’s proxy. A proxied record lets the edge receive the request and apply the redirect.
  2. Confirm that the provider issues a certificate for blog.example.com. Test both HTTP and HTTPS; HTTPS must complete certificate validation before the redirect can be followed.
  3. Open the Rules area and create a Single Redirect for requests whose hostname is blog.example.com.
  4. Set the target to preserve the incoming path. A documented dynamic target is concat("https://example.com", http.request.uri.path). If the destination is a folder, include it in the target, for example concat("https://example.com/blog", http.request.uri.path).
  5. Enable query-string preservation when the rule interface provides that option. Verify that parameters are not dropped or duplicated.
  6. Choose status code 301 for a permanent move. Use 308 only when you specifically want the permanent status that preserves the request method; do not use a temporary 302 for a migration intended to last.
  7. Deploy the rule and inspect a sample article, a missing article, a feed, a trailing-slash variant, and a URL containing a query string.

Edge rules can have account- or plan-specific limits, so check the rule’s scope and ordering if another redirect, page rule, or worker also matches the hostname. The intended result is one redirect from the old URL directly to the final HTTPS URL.

Method 2: Redirect with Apache

Use an Apache virtual host or .htaccess when your origin server controls the response. Match the old hostname explicitly so requests already on the main domain cannot loop back through the rule.

Virtual-host or server configuration

Place the rule in the HTTP and HTTPS virtual hosts that answer for the old hostname, or in the appropriate server configuration included by your host:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^blog.example.com$ [NC]
RewriteRule ^(.*)$ https://example.com$1 [R=301,L]

The documented Apache pattern uses RewriteRule with [R=301,L]. The capture preserves the path, so /guides/setup becomes https://example.com/guides/setup. Apache normally carries the original query string forward when the substitution does not specify a new one.

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

When the blog is moving into a folder

Include the destination folder in the substitution:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^blog.example.com$ [NC]
RewriteRule ^(.*)$ https://example.com/blog$1 [R=301,L]

For a hand-curated set of changed slugs, use individual rules before the general catch-all:

RewriteRule ^old-title/?$ https://example.com/new-title [R=301,L]
RewriteRule ^guides/setup/?$ https://example.com/blog/guides/setup [R=301,L]

Apache checks

  • Confirm the old hostname resolves to this Apache server and that its certificate is valid.
  • Put specific article rules above a broad rule; the L flag stops processing after the first match.
  • Reload or restart Apache after changing server configuration. A syntax error can prevent the service from reloading.
  • Test both slash forms if your application treats /article and /article/ differently.

Method 3: Redirect with Nginx

Nginx uses a server block selected by server_name. A simple permanent redirect preserves the request URI:

server {
    listen 443 ssl;
    server_name blog.example.com;

    ssl_certificate     /path/to/blog.crt;
    ssl_certificate_key /path/to/blog.key;

    return 301 https://example.com$request_uri;
}

$request_uri includes the path and query string. To move the content under /blog, use:

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.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
return 301 https://example.com/blog$request_uri;

Do not place the old and new hostnames in the same redirecting block without a clear condition. Make sure the certificate paths are valid, test the configuration with your host’s Nginx validation command, and reload only after validation succeeds.

Method 4: Hosting-panel forwarding

Managed hosting panels may offer “URL forwarding,” “domain forwarding,” or a redirect tool. This is suitable when you cannot edit Apache or Nginx directly, but behavior varies by provider.

  • Check whether forwarding accepts a subdomain or only an entire domain.
  • Confirm that it supports HTTPS on the old hostname and supplies a certificate.
  • Verify that paths are preserved. Some panels redirect every request to one fixed URL.
  • Check query-string handling and whether the panel emits 301, 302, or 308.
  • Look for an option that redirects directly to the final URL rather than adding an intermediate hop.

If the panel cannot preserve paths, use a CDN rule or origin-server configuration instead. A fixed homepage redirect is a poor substitute for an article-by-article migration.

Moving a blog from a subdomain into a main-domain folder

The technical pattern is the same, but the destination has an extra path segment. First create the new folder structure and publish the pages there. Then map each old URL to its corresponding folder URL.

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.

Choose between a mechanical and a curated map

  • Mechanical map: use one rule when every old path gains the same prefix, such as https://blog.example.com/post to https://example.com/blog/post.
  • Curated map: use a redirect list when slugs changed, content was consolidated, or sections moved to different destinations.

Keep article relevance as the deciding factor. If an old post was merged into a guide, redirect it to the section that replaces its information, not automatically to the folder root.

SEO and site signals to update

A redirect transfers visitors, but the rest of the site must announce the new canonical location. Change internal navigation links so new visitors do not continue entering through the old host. Regenerate XML sitemaps with the main-domain URLs, update canonical tags, replace old URLs in structured data, and update feed links. Change analytics host settings or filters if they distinguish the subdomain from the main domain.

Keep the old host available and redirecting while search engines recrawl it. Do not remove the DNS record immediately after launch: without DNS and a valid certificate, the browser cannot reach the redirect response.

There is no guaranteed ranking-retention percentage for a move. Results depend on whether each old URL has a relevant equivalent, whether the response is a true permanent server-side redirect, and whether search engines can crawl both hostnames without certificate or loop errors.

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

Test the migration before retiring the old blog

Use an HTTP header tool or a command-line client to inspect the complete chain. For example:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
curl -I http://blog.example.com/guides/setup
curl -I https://blog.example.com/guides/setup?source=newsletter

For each request, verify that the response is one intended 301 or 308 and that the Location header is the final HTTPS URL. Follow the chain separately when necessary:

curl -I -L https://blog.example.com/guides/setup

Minimum test matrix

  • HTTP and HTTPS versions of the old hostname.
  • The bare subdomain and any commonly used hostname variants.
  • A representative article with a short path and one with nested directories.
  • Trailing-slash and non-trailing-slash forms where both have existed.
  • A URL with campaign or search parameters.
  • An XML feed and other important non-HTML endpoints.
  • A missing old URL, confirming that your fallback is intentional.
  • The final main-domain URL, confirming that it does not redirect back to the subdomain.

Inspect the browser’s certificate warning status, response code, destination host, path, and query string. The ideal chain is one redirect from the old URL to the final canonical HTTPS URL. Multiple hops slow retrieval and make troubleshooting harder; loops indicate that a rule is matching the destination host or that HTTP-to-HTTPS rules conflict.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

DNS resolves, but the browser shows an error

Check that the A, AAAA, or CNAME record points to the service containing the redirect and that proxy status is correct. If the record is DNS-only, the origin must answer on the old hostname and present its certificate.

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

HTTPS reports a certificate error before redirecting

Install or enable a certificate covering blog.example.com. A redirect cannot repair a TLS handshake that fails before HTTP begins.

The path disappears or every page goes to the homepage

Replace a fixed destination with a path-preserving rule, or create a complete mapping table for changed slugs. Check query-string preservation separately; path preservation does not always imply parameter preservation in a hosting panel.

A redirect loop occurs

Inspect every rule in the CDN, load balancer, web server, and application. The old-host rule should match only blog.example.com, while the main domain should have its own canonical HTTPS policy. Remove any rule that sends the final hostname back to the old one.

Some URLs redirect twice or more

Find the intermediate Location value with a header inspection. Change the old-host rule to point directly to the final HTTPS URL and consolidate separate HTTP, HTTPS, and hostname rules where possible.

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

How long to keep the redirect

There is no universal DNS-propagation or ranking-recovery duration. Timing depends on DNS TTLs, resolver and browser caches, certificate setup, crawler scheduling, and the completeness of your URL map. Keep DNS and redirects active long enough for users and crawlers to encounter the old addresses; do not base retirement on a fixed number of days.

Which implementation should you choose?

Method Control point Best fit Critical checks
DNS/CDN redirect Proxy and redirect-rule layer DNS managed by a provider with edge redirects Proxied record, certificate coverage, path and query preservation, rule limits
Apache .htaccess or server config Origin web server Self-managed Apache hosting Correct host match, rewrite ordering, 301 syntax, HTTPS handling
Nginx server block Origin web server VPS or managed Nginx server_name, return 301, URI variables, certificate configuration
Hosting-panel forwarding Hosting control panel Managed shared hosting Path preservation, HTTPS support, query-string behavior, status code

For a permanent move, use the layer you control most reliably, return one 301 or 308 to the final HTTPS URL, preserve equivalent paths and relevant query strings, and leave the old hostname reachable until the migration has been recrawled.

Frequently Asked Questions

Can I redirect a subdomain with DNS alone?

No. DNS only resolves blog.example.com to infrastructure. A CDN, hosting panel, Apache, Nginx, or another HTTP service must return the 301 or 308 response. A provider’s DNS-dashboard redirect is an edge HTTP feature, not a DNS record.

Will a 301 redirect preserve my blog URLs and SEO?

A 301 can preserve the path, query string, and the migration signal when each old URL points to a relevant new URL. It does not preserve anything automatically if a rule sends every article to the homepage. Update canonical tags, sitemaps, internal links, feeds, structured data, and analytics settings as well.

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

Should I use 301 or 308?

Use 301 for most permanent blog moves. Both 301 and 308 communicate permanence; 308 is useful when the original request method must be preserved. Do not use 302 for a move intended to last.

How do I move blog.example.com into example.com/blog?

Publish the new folder URLs first, then prepend /blog while preserving each old path, or create a curated one-to-one map for changed slugs. For example, /guides/setup can become https://example.com/blog/guides/setup. Redirect consolidated articles to the section that replaces them.

Does the old subdomain need its own SSL certificate?

Yes. The browser completes the old hostname’s TLS handshake before it can receive a redirect. The certificate must cover blog.example.com; with DNS-only hosting, configure it at the origin, while a proxied CDN may provide coverage at the edge.

Should feeds, images, and query strings redirect too?

Yes, map important feeds, assets, and non-HTML endpoints rather than only article pages. Preserve campaign and search parameters when they remain useful, and verify the provider’s query-string setting so values are not dropped or duplicated.

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

How long should I keep the old redirect?

There is no fixed number of days that works for every site. DNS TTLs, caches, certificate setup, crawler schedules, and the completeness of the URL map affect timing. Keep the old DNS record, certificate, and redirects available while users and crawlers continue to encounter old URLs.

Why do I get a certificate error, redirect loop, or multiple hops?

A certificate error means TLS fails before HTTP, so install coverage for the old hostname. A loop usually means the rule also matches the final main domain or conflicts with an HTTPS policy. Multiple hops mean another CDN, server, or application rule is intervening; inspect each Location header and point the old host directly to the final HTTPS URL.

The Bottom Line

Keep blog.example.com resolvable and HTTPS-valid, then return one permanent 301 or 308 to the relevant final URL. Preserve paths and useful query strings, update every site signal, test both hostnames and edge cases, and keep the old mapping active until users and crawlers have found the new addresses.

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.

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

301 redirectsApacheCloudflareDNSNGINXSEOWebsite Migration

Leave a Reply

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

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.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
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.