Subdomain-to-Subfolder 301 Consolidation Planner (Nginx & Cloudflare).
Consolidate blog.domain.com into domain.com/blog/ safely: generate exact path-preserving Nginx and Cloudflare 301 redirect rules.
# Nginx Server Block (blog.yourwebsite.co.il -> https://yourwebsite.co.il/blog)
server {
listen 443 ssl http2;
server_name blog.yourwebsite.co.il;
return 301 https://yourwebsite.co.il/blog$request_uri;
}
# Cloudflare Redirect Rule Expression
(http.host eq "blog.yourwebsite.co.il") -> Dynamic 301: concat("https://yourwebsite.co.il/blog", http.request.uri.path)How to use this in your SEO workflow
- Moving an isolated blog or docs subdomain into a root subfolder consolidates link equity onto your primary commercial domain.
- Preserve identical URL slugs where possible so edge wildcard 301s route cleanly in 1 hop.
- Keep both the old subdomain and root domain verified in Google Search Console for at least 180 days.
Related in-depth SEO guides
Strategy
Map Every Traffic-Bearing Old Address Before Launch Day
Build a complete old-URL inventory from Search Console, Backlinks and Top Pages so zero organic equity gets stranded on launch day.
Data readingResolve Ambiguous and Shared Destinations Manually
Why Serpo leaves ambiguous slugs unmatched instead of guessing—and how to review shared destinations safely.