Advanced Guide
Setting Up Redirects on Popular Platforms
Step-by-step instructions for configuring redirects on the platforms you use.
Published April 2026 • 15 min read
WordPress
WordPress is the most popular CMS, and setting up redirects is straightforward with the right plugins.
Using Redirection Plugin (Easiest)
- Install and activate the "Redirection" plugin from the WordPress plugin directory
- Go to Tools → Redirection in your WordPress admin panel
- Enter the old URL in "Source URL" field
- Enter the new URL in "Target URL" field
- Select "301 - Moved Permanently" or "302 - Found" depending on your needs
- Click "Add Redirect" to save
Using .htaccess (Advanced)
For WordPress sites on Apache servers, edit the .htaccess file in your root directory:
# Single redirect Redirect 301 /old-page.html https://yoursite.com/new-page.html # Redirect entire directory Redirect 301 /old-folder/ https://yoursite.com/new-folder/
Apache (HTTP Server)
Using .htaccess
Add this code to your .htaccess file in the root directory:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain\.com [NC]
RewriteRule ^(.*)$ https://new-domain.com/$1 [L,R=301]
# Redirect specific page
RewriteRule ^about-us/?$ /about-page [R=301,L]Using VirtualHost Configuration
Edit your Apache configuration file (usually in /etc/apache2/sites-available/):
<VirtualHost *:80>
ServerName old-domain.com
Redirect 301 / https://new-domain.com/
</VirtualHost>Nginx
Nginx uses server blocks instead of .htaccess files. Edit your server configuration file (usually in /etc/nginx/sites-available/):
Basic Server Block Redirect
server {
listen 80;
server_name old-domain.com;
return 301 https://new-domain.com$request_uri;
}
# Redirect specific paths
location /old-page {
return 301 https://your-domain.com/new-page;
}After making changes:
sudo nginx -t sudo systemctl reload nginx
cPanel / Shared Hosting
Using the Redirects Tool
- Log into your cPanel account
- Click on "Redirects" under the Domains section
- Choose the domain you want to redirect from
- Enter the old URL path (e.g., /old-page)
- Enter the new URL or external destination
- Choose redirect type (permanent or temporary)
- Click "Add Redirect"
Cloudflare
Using Bulk Redirects
- Log into your Cloudflare account
- Go to Rules → Redirects
- Click "Create Redirect"
- Enter the source URL and destination URL
- Choose status code (301, 302, etc.)
- Enable the redirect and save
Note: Cloudflare redirects are handled at the edge, so they're extremely fast. This is ideal for redirecting entire sites or domains.
Vercel
Using next.config.js
If you're using Next.js on Vercel, add redirects to your next.config.js:
module.exports = {
async redirects() {
return [
{
source: '/old-page',
destination: '/new-page',
permanent: true, // 301
},
{
source: '/blog/:slug',
destination: '/articles/:slug',
permanent: true,
},
]
},
}Best Practices for All Platforms
Test Every Redirect
After setting up redirects, test them immediately. Use TraceRedirect to verify the redirect chain is correct.
Use Permanent When Appropriate
Use 301 redirects for permanent moves. Browsers cache these, improving performance. Use 302 only for temporary redirects.
Avoid Chains
Redirect directly to the final destination. Don't create A → B → C chains. Update your configuration to point A directly to C.
Verify Your Redirects
After setting up redirects on your platform, use TraceRedirect to verify they're working correctly and optimized.
Check Your Redirects