Learning how to set up 301 redirects comes down to choosing where to apply the rule: at your server level, inside your content management system, or via an edge proxy. The fastest route is to map your old URL paths directly to their new destinations and insert the directive into your server configuration or CMS redirect manager. Done correctly, an HTTP 301 status code tells browsers and search engine crawlers that a resource has moved permanently, transferring traffic and accumulated authority to the new target.

Which redirect method should you choose?

The right way to implement a 301 redirect depends on how much access you have to your hosting environment and how many URLs you need to point. Every request requires processing, so putting rules closer to the server root keeps response times low.

Method Best For Pros Cons
Server Config (Nginx / Apache) Site migrations, bulk lists, developer access Fastest execution, handles thousands of rules cleanly Requires root server access or file editing permissions
CMS Settings (Shopify / Squarespace) Hosted e-commerce and portfolio sites Built into the admin dashboard, no coding required Limited syntax options; cannot handle server-level rewrites
WordPress Plugins Small to medium blogs on shared hosting Simple interface, regular expression support Executes through PHP, which uses more database and server memory
Edge / Cloudflare Rules Static sites, headless frontends, DNS management Intercepts requests before they hit your origin host Free tier rules can be limited in volume

If you have a small list of five pages, an admin dashboard works well. If you are handling a site migration or changing your directory structure, generating raw configuration directives saves time and prevents server bloat.

Generating redirect rules for server configs

Writing individual redirect rules by hand invites syntax errors, misplaced slashes, and endless redirect loops. The Links to Wild 301 Redirect Generator processes your old and new URLs in your browser to produce valid syntax for Apache .htaccess, Nginx, Netlify, Cloudflare, or WordPress.

  1. Collect your old and new URL pairs in a spreadsheet or plain text document.
  2. Open the 301 Redirect Generator and paste your list into the tool.
  3. Select your target platform (such as Apache, Nginx, or Netlify).
  4. Review the flags for chains, loops, and duplicate sources before taking the output. The tool checks the list against itself entirely inside your browser, meaning unreleased staging URLs remain completely private.
  5. Copy the formatted directives into your clipboard for deployment.

How to configure Apache and Nginx manually

Direct server rules execute before the CMS loads, making them the most efficient choice for high-traffic sites.

Editing an Apache .htaccess file

On Apache servers, redirects usually live in the .htaccess file inside your website root directory (often public_html).

  1. Connect to your server via SFTP or open your hosting control panel file manager.
  2. Locate the .htaccess file in the document root. If it is hidden, enable viewing hidden files in your FTP client.
  3. Download a backup copy to your computer before making edits.
  4. Open the file in a text editor and make sure RewriteEngine On is present at the top of the block.
  5. Add your specific 301 rule using Redirect 301 or RewriteRule:

    Redirect 301 /old-page https://example.com/new-page

  6. Save the file and upload it back to the server root.

Editing an Nginx configuration file

Nginx does not use .htaccess files. Instead, rules must go inside the server block of your configuration file (usually found at /etc/nginx/sites-available/example.com).

  1. Log into your server via SSH with sudo or root privileges.
  2. Open your site configuration file using a terminal text editor like nano.
  3. Locate the active server { ... } block for your domain.
  4. Add a rewrite or return directive:

    rewrite ^/old-page$ /new-page permanent;

    Alternatively, use an exact location block: location = /old-page { return 301 /new-page; }

  5. Test the configuration syntax by running sudo nginx -t in your terminal.
  6. If the test passes, reload the web server with sudo systemctl reload nginx.

How to set up 301 redirects in WordPress

If you run WordPress without direct access to web server configuration files, you can handle redirects through dedicated plugins or built-in SEO tools.

  1. Install an established redirect plugin such as Redirection, or use the redirect manager included with plugins like Rank Math or Yoast SEO Premium.
  2. Navigate to the redirect management screen in your WordPress admin menu (usually under Tools > Redirection).
  3. Enter the relative path of the source URL into the Source URL field (for example, /old-post/). When planning path changes, review what is a URL slug to keep targets readable and clean.
  4. Enter the target destination into the Target URL field. This can be a relative path or a full URL if sending users off-site.
  5. Confirm that the HTTP code is set to 301 Moved Permanently.
  6. Save the redirect and test the old URL in a private browser window.

How to manage redirects in Shopify, Squarespace, and Wix

Cloud-hosted website builders do not provide server access, but they offer built-in redirect tools inside their dashboards.

Shopify

  1. From your Shopify admin dashboard, navigate to Online Store > Navigation.
  2. Click View URL Redirects at the top of the page.
  3. Click Create URL redirect.
  4. In Redirect from, enter the old relative path (for example, /products/old-item). Note that Shopify will not allow you to redirect URLs that still have an active product, page, or collection using that slug.
  5. In Redirect to, enter the new destination path.
  6. Click Save redirect.

Squarespace

  1. Open your Squarespace dashboard and click Settings.
  2. Go to Developer Tools (or Advanced, depending on your version) and select URL Mappings.
  3. Add your mapping on a new line using Squarespace syntax:

    /old-path -> /new-path 301

  4. Click Save in the top panel.

Wix

  1. Open your Wix site dashboard and go to Marketing & SEO > SEO.
  2. Select URL Redirect Manager.
  3. Click + New Redirect.
  4. Choose Single redirect, then enter the old URL slug and the target page.
  5. Click Save & Close.

GoDaddy Domain Forwarding

If you bought an entirely new domain on GoDaddy and need to route traffic from the old domain name, use forwarding:

  1. Log into your GoDaddy Domain Portfolio.
  2. Select the domain you want to redirect and click Manage DNS or scroll to Forwarding.
  3. Click Add Forwarding under the Domain section.
  4. Enter the destination URL, select Permanent (301) as the forward type, and choose whether to forward with or without masking (masking should be disabled for SEO purposes).
  5. Save your changes. DNS records may take up to 24 to 48 hours to update worldwide.

Testing your redirects and avoiding common mistakes

Setting up your rules is only half the process; you also need to confirm that servers handle requests cleanly.

Chains and Loops

A redirect chain happens when URL A points to URL B, which then forwards to URL C. Each intermediate hop increases loading time, consumes search engine crawl budget, and can leak authority. To evaluate how multiple hops impact your site, review the Link Equity Calculator. Always resolve chains so that URL A points straight to URL C. If you have built an extensive URL map, check it with the Redirect Chain Analyzer to spot nested sequences before publication.

The Soft 404 Homepage Trap

When deleting multiple pages, site owners often set up bulk redirects pointing every abandoned URL back to the homepage. As stated in official documentation on Google Search Central, search engines treat redirects to non-equivalent destinations as soft 404 errors. If a page about blue running shoes disappears, redirect it to the running shoe category or an equivalent footwear page. If no similar page exists, serving an HTTP 404 or 410 status code is cleaner than dumping the user on the homepage.

How to verify status codes

Never test redirects by pasting URLs into your everyday browser, because browsers cache 301 responses aggressively. Use terminal commands or dedicated tools:

  1. Open your terminal and run a curl command to inspect response headers:

    curl -ILs https://example.com/old-page | grep -E "HTTP|Location"

  2. Look for an immediate HTTP/1.1 301 Moved Permanently followed by a Location: https://example.com/new-page header.
  3. Check that the second response returns HTTP/1.1 200 OK. If you see intermediate hops, collapse them. You can inspect responses using our HTTP Status Code Checker to confirm how crawlers interpret your headers.

Frequently Asked Questions

Should I use a 301 or 302 redirect?

Use a 301 redirect for any page that is moving permanently. A 302 redirect tells search engines to keep the old URL indexed and avoid transferring ranking signals, which is useful for split testing or temporary promotions. Over time, search engines may treat long-standing 302 redirects as 301s, but using the wrong code delays the transfer of search equity.

What is a 308 redirect, and when should I use it?

A 301 redirect allows web browsers to change a POST request into a GET request upon forwarding. A 308 redirect is a permanent redirect that requires clients to preserve the original HTTP method and body. For standard website articles, a 301 is preferred because it has broader client support. For APIs, payment endpoints, or forms handling submitted user data, a 308 redirect prevents the request body from dropping silently.

How long should I keep 301 redirects active?

Keep your redirects active for at least one year. This allows search engines sufficient time to crawl every path, update index databases, and transfer authority. If the original URL has earned backlinks from external websites, maintain that 301 redirect indefinitely so you preserve that inbound authority.

Can I redirect an entire discontinued website to my new homepage?

You can, but it rarely preserves search performance. Search crawlers evaluate redirect relevance; routing hundreds of specific articles to an unrelated homepage triggers soft 404 warnings, causing the URLs to drop out of the index without transferring authority. Map each individual page to its closest matching alternative. If no comparable page exists, let the old URL return a 404 or 410 code.

Does the Links to Wild generator test live site URLs?

No. The generator runs entirely within your browser to protect your privacy and does not send network requests to your website. It analyzes your input list against itself to identify syntax issues, duplicate sources, chains, and loops. Once you deploy the generated rules to your server, you should test the live URLs directly using curl or a crawler.

Explore Links to Wild

🌩
View Pricing

Link building packages from $600

🧭
About Hayk

The story behind Links to Wild

✉
Get in Touch

Book a call or send a message