Sometimes, you want to redirect every page on your website to the homepage — maybe you’re rebuilding your site, turning it into a one-pager, or hiding old content. But if you’ve ever tried this using a plugin like Redirection, you might have run into the dreaded redirect loop.
Here’s a simple, loop-free way to redirect all pages except the homepage — using the free and trusted Redirection plugin for WordPress.
✅ Step-by-Step: Redirect All Pages to the Homepage
- Install and activate the Redirection plugin from your WordPress dashboard.
- Go to Tools > Redirection.
- Click “Add New” to create a new redirect.
- Use the following settings:
- Source URL:
^/(?!$).+
- Target URL:
/
- Click the gear icon (⚙️) and check “Regex”.
- Click Add Redirect.
🔍 Why This Works
The regular expression ^/(?!$).+
tells WordPress to:
- Match any URL that isn’t exactly the homepage
- And redirect it to the homepage (
/
)
That means:
/about
➜/
/contact
➜/
- But
/
(the homepage itself) stays right where it is ✅
No loop. No errors. Clean and effective.
🛠 Want to Exclude Specific Pages?
You can tweak the redirect to exclude certain pages like /contact
or /login
by using this regex instead:
^/(?!($|contact|login)).+
This setup:
- Still redirects everything except:
- The homepage
/contact
/login
🧩 When Should You Use This?
- You’re rebuilding your website and want all traffic to land on your homepage
- You’re switching to a single-page layout
- You’re hiding outdated pages while keeping your homepage active
Need help setting this up on your site?
Drop me a message — I build fast, frugal, and frictionless websites that just work.