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)

  1. Install and activate the "Redirection" plugin from the WordPress plugin directory
  2. Go to Tools → Redirection in your WordPress admin panel
  3. Enter the old URL in "Source URL" field
  4. Enter the new URL in "Target URL" field
  5. Select "301 - Moved Permanently" or "302 - Found" depending on your needs
  6. 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

  1. Log into your cPanel account
  2. Click on "Redirects" under the Domains section
  3. Choose the domain you want to redirect from
  4. Enter the old URL path (e.g., /old-page)
  5. Enter the new URL or external destination
  6. Choose redirect type (permanent or temporary)
  7. Click "Add Redirect"

Cloudflare

Using Bulk Redirects

  1. Log into your Cloudflare account
  2. Go to Rules → Redirects
  3. Click "Create Redirect"
  4. Enter the source URL and destination URL
  5. Choose status code (301, 302, etc.)
  6. 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