You're trying to redirect from a subdomain to a root domain while preserving the full URL path (for example, sub.example.com/page1
→ example.com/page1
). Webflow doesn’t support path forwarding via its native redirect settings, but here are alternative methods to achieve this.
1. Use Cloudflare Page Rules (If Using Cloudflare)
- Point both the subdomain and root domain to Cloudflare by updating their DNS records to Cloudflare’s nameservers.
- In Cloudflare > Page Rules, create a rule like:
- URL pattern:
https://sub.example.com/*
- Forwarding URL (302 or 301):
https://example.com/$1
$1
passes the original path and query string to the root domain.
- Host a simple reverse proxy using Cloudflare Workers, AWS CloudFront + Lambda@Edge, or Vercel to intercept traffic.
- Detect all requests to the subdomain and return a 301 redirect to the root domain, appending the full path.
- Example logic:
Return 301 Location: https://example.com{original path}
.
3. Use Netlify or Vercel for Redirect Service
- Set up a Netlify or Vercel site for your subdomain.
- In their configuration (e.g.,
_redirects
file for Netlify), add: /* https://example.com/:splat 301!
- This preserves the path and permanently redirects to the root domain.
4. Nginx or Apache Rewrite Rules (If You Control the Server)
- If you have server control, add a rule like:
- Nginx:
rewrite ^/(.*)$ https://example.com/$1 permanent;
- Apache:
RedirectMatch 301 ^/(.*)$ https://example.com/$1
- This ensures a full path redirect without Webflow involvement.
5. Webflow’s Native Redirects (Not Suitable for Path Forwarding)
- Webflow’s Project Settings > Hosting > 301 Redirects only supports path-level redirects within the same domain.
- You cannot use it to preserve paths when switching to/from subdomains.
Summary
To forward the full URL path from a subdomain to a root domain in Webflow, use external redirect services like Cloudflare Page Rules or Netlify. Webflow alone can’t handle full path redirects across subdomains.