How to Set Up a 301 Redirect: Complete Guide for Marketers

A 301 redirect permanently forwards one URL to another. It's one of the most useful tools in web management — whether you're moving pages, rebranding, consolidating content, or creating memorable short links.

In this guide, we'll cover what 301 redirects are, when to use them, and how to set them up using different methods.

What Is a 301 Redirect?

A 301 redirect tells browsers and search engines that a page has permanently moved to a new location. When someone visits the old URL, they're automatically sent to the new one.

Key characteristics:

  • Permanent: Search engines transfer ranking signals (link equity) to the new URL
  • Automatic: Users are redirected instantly without clicking anything
  • SEO-friendly: Google treats 301 redirects as a signal to index the new URL instead of the old one

301 vs. 302 Redirects

Feature301 Redirect302 Redirect
TypePermanentTemporary
SEO valuePasses link equityDoes not pass link equity
Browser cachingBrowsers cache the redirectBrowsers check each time
Use casePage moved permanentlyPage temporarily unavailable

Use a 301 when the move is permanent. Use a 302 when you plan to bring the original URL back.

When to Use 301 Redirects

Website Migration

Moving to a new domain? Set up 301 redirects from every old URL to its equivalent on the new domain to preserve search rankings.

URL Structure Changes

If you change your URL structure (e.g., from /blog/2024/post-title to /blog/post-title), redirect the old URLs to avoid broken links.

Content Consolidation

Merging multiple pages about similar topics? Redirect the weaker pages to the strongest one to concentrate SEO authority.

Rebranding

Changed your company name or domain? 301 redirects ensure old links still work.

Vanity URLs

Create memorable URLs like yourbrand.com/demo that redirect to longer, less memorable destinations.

Method 1: Apache (.htaccess)

If your site runs on Apache, add redirect rules to your .htaccess file:

# Single page redirect
Redirect 301 /old-page https://www.example.com/new-page

# Pattern-based redirect
RewriteEngine On
RewriteRule ^old-directory/(.*)$ https://www.example.com/new-directory/$1 [R=301,L]

Method 2: Nginx

In your Nginx server configuration:

# Single page redirect
location = /old-page {
    return 301 https://www.example.com/new-page;
}

# Pattern-based redirect
location /old-directory/ {
    rewrite ^/old-directory/(.*)$ https://www.example.com/new-directory/$1 permanent;
}

Method 3: Cloudflare Page Rules

If you use Cloudflare, you can set up redirects without touching your server:

  1. 1Go to RulesPage Rules
  2. 2Enter the URL pattern to match
  3. 3Choose Forwarding URL with status 301
  4. 4Enter the destination URL

Method 4: WordPress Plugins

WordPress users can use plugins like Redirection or Yoast SEO Premium:

  1. 1Install the Redirection plugin
  2. 2Go to ToolsRedirection
  3. 3Enter the source URL and target URL
  4. 4Set the type to 301 Moved Permanently

Method 5: URL Shortener (Easiest)

The simplest way to create 301 redirects — especially for marketing links, vanity URLs, and trackable links — is with a URL shortener like Linkly.

  1. 1Paste your destination URL into Linkly
  2. 2Choose a custom slug (e.g., yourdomain.com/demo)
  3. 3Your 301 redirect is live instantly

Benefits over server-side redirects:

  • No server access needed — anyone on the team can create redirects
  • Click tracking included — see who clicks, when, and from where
  • Easy to update — change the destination URL anytime without touching code
  • Custom domains — use your own branded domain

SEO Considerations

Link Equity Transfer

301 redirects pass most link equity (ranking power) to the destination URL. This makes them essential during site migrations.

Redirect Chains

Avoid chaining redirects (A → B → C). Each hop reduces page load speed and can dilute SEO value. Redirect directly from the old URL to the final destination.

Crawl Budget

Too many redirects can waste crawl budget. After a migration, keep redirects in place for at least a year, then consider removing ones that get zero traffic.

Avoid Redirect Loops

A redirect loop (A → B → A) makes the page completely inaccessible. Always test your redirects after setting them up.

Testing Your 301 Redirect

Verify your redirect is working correctly:

  1. 1Browser test: Visit the old URL and confirm you land on the new page
  2. 2Check the status code: Use browser dev tools (Network tab) to verify the response is 301, not 302
  3. 3Test with curl: curl -I https://old-url.com shows the HTTP status code and Location header

Common Mistakes

  • Using 302 instead of 301: This doesn't pass SEO value
  • Forgetting trailing slashes: /page and /page/ may need separate rules
  • Not updating internal links: Fix your site's internal links to point directly to the new URL, don't rely on redirects
  • Redirecting everything to the homepage: Each old page should redirect to its closest equivalent, not a catch-all

Conclusion

301 redirects are essential for maintaining link equity, preventing broken links, and creating clean marketing URLs. Whether you set them up at the server level or use a URL shortener, the key is choosing the right method for your situation.

Need easy 301 redirects with tracking? Get started with Linkly and create managed redirects with click analytics, custom domains, and no server configuration needed.

Track 500 monthly clicks with all features included.

No credit card required