Back to articles

Host WordPress in a Subdirectory Without a Painful Migration

Serve WordPress at /blog with a serverless reverse proxy—keep plugins, themes, uptime, and SEO intact.

Dec 7, 2025
• BlogPath Team
wordpress migration performance
Host WordPress in a Subdirectory Without a Painful Migration

Host WordPress in a Subdirectory Without a Painful Migration

You want WordPress at /blog for SEO and attribution, but replatforming is risky. A reverse proxy lets you keep your current WordPress stack while serving it from the main domain.

Table of Contents

Why move WordPress to /blog

  • Subdirectory consolidates link equity and accelerates rankings.
  • Analytics and conversions stay in one property.
  • Better sitelinks and richer snippets.

The proxy-based approach

A serverless, high-performance reverse proxy fronts WordPress:

  • Routes /blog/* to blog.origin.example.com, stripping /blog.
  • Edge caching for static assets; short TTL for HTML.
  • WAF + bot filtering to shield origin; respects cookies for logged-in users.

Prereqs and DNS setup

  • Enable SSL on origin; stable permalinks.
  • Reserve an origin host (e.g., blog.origin.example.com) pointing to WordPress.
  • Keep DNS TTL low (300s) for rollback.

Step-by-step implementation

  1. Map URL structure 1:1; avoid slug changes.
  2. Configure proxy rules: preserve query strings, headers, and IP forwarding.
  3. Exclude /wp-admin and /wp-login from caching.
  4. Set canonicals to /blog URLs; update sitemap location.
  5. Test forms, search, feeds, and media.
  6. Launch with staged traffic (e.g., 10% → 50% → 100%).

QA and rollback plan

  • Pre-launch: run crawl, compare 200/301/404 parity, check mixed content.
  • Launch: monitor error rates and Core Web Vitals.
  • Rollback: revert DNS/CNAME; cached content expires quickly with low TTL.

Caching and performance tips

  • Cache HTML for anonymous users with short TTL; bypass on cookies.
  • Aggressive caching for images/CSS/JS with versioned assets.
  • Enable Brotli/Gzip; lazy-load images; consider AVIF/WebP.
  • Measure TTFB and LCP improvements via PageSpeed Insights.

SEO checks after launch

  • Verify Search Console for the root; fetch/render /blog.
  • Track rankings for primary keywords and branded queries.
  • Watch 404s and redirect chains; fix quickly.
  • Submit updated sitemap; ensure canonicals point to /blog.

Internal linking playbook

  • Add 4–8 internal links from this post to high-intent product or feature pages (pricing, docs, case studies).
  • Within 24 hours, add 2–3 links from older, high-traffic posts to this guide using partial-match anchors (e.g., “WordPress subdirectory setup”, “reverse proxy for WordPress”).
  • Build a pillar page for “WordPress performance” and cluster this post under it; cross-link to reverse-proxy-wordpress-speed.md, blog-edge-caching-multi-region.md, and subdirectory-blog-security.md.
  • Ensure your nav/footer links include /blog to distribute authority; avoid orphan URLs.
  • Update the XML sitemap and check for canonical consistency.

Performance benchmarking plan

  • Baseline before cutover: run PageSpeed Insights and WebPageTest for three key geos (NA/EU/APAC); log TTFB, LCP, INP, CLS.
  • After proxy go-live, re-run the same tests; aim for ≥30% TTFB reduction and LCP <2.5s on mobile.
  • Monitor cache hit ratio at the edge; add rules for image-heavy posts to improve hit rate.
  • Track origin CPU/memory; a healthy reverse proxy reduces origin load and 5xx rates.
  • Set alerts on 404/500 spikes and rising redirect chains.

Advanced FAQ

How many redirects are acceptable during cutover?

Keep it to a single hop. Old subdomain → /blog/* with 301s. Avoid chains like subdomain → temp page → /blog.

Can I cache HTML without breaking logins?

Yes—cache only for anonymous traffic and bypass on auth cookies. Exclude /wp-admin, /wp-login, and preview routes.

No. Keep slugs identical to preserve rankings. Only adjust if they are truly harmful (e.g., querystring-based), and then redirect carefully.

How do I handle media and CDNs?

Let the reverse proxy cache images with long TTLs; keep origin URLs stable. Consider WebP/AVIF and responsive image sizes.

What if I need rollback?

Keep DNS TTL at 300s, retain old configs, and maintain an origin-only hostname. Revert DNS to the prior target if metrics degrade.

Why choose BlogPath.io

  • Global CDN caching + WAF + origin shielding preconfigured for WordPress; no YAML or Nginx editing.
  • Zero-code deployment: change DNS, keep your CMS and plugins intact.
  • Observability baked in: cache hit ratios, error logs, and Web Vitals visibility.
  • Reliability: multi-region edge, uptime focus, and reversible rollout steps.
  • Speed: serverless edge delivers faster TTFB without rebuilding your theme.