301 redirect generator

A 301 redirect generator helps you create a permanent redirect rule from an old URL to a new one without manually writing the syntax. This approach is necessary when changing the site structure, moving sections, changing friendly URLs, moving to a different domain, or switching from HTTP to HTTPS.

Load the list from a file

One pair per line: the old address and the new one. We detect the separator ourselves, or you can set it below.

/old-page/ → /new-page/

Settings

Everything is computed in your browser — not a single line leaves it.

The ready code

The code appears as soon as you fill the fields: it will hold no empty values and no invented placeholders.

Checks

  • Fill in the field: there is nothing to work with

What to do next

Send a requestOur service: website promotion

How does a 301 redirect generator work?

To create a 301 redirect, simply specify the source and destination URLs, select the appropriate rule format, and get the ready-made code. Once implemented, the old URL should return an HTTP response code of 301, and the new URL should open directly without any unnecessary intermediate steps.

The online redirect generator converts entered URLs into a ready-made rule for the selected server configuration. The user doesn't have to manually check the placement of slashes, the syntax of directives, and the structure of each standard redirect. However, the resulting code still needs to be verified before implementation on the live site.

Typically, the process takes several steps: first, you specify the old URL, then you specify the new URL, and then you select the desired configuration option. The service generates redirect code, which can be copied and pasted into the appropriate file or server block.

What should I specify in the generator fields?

The source URL field specifies the page that should no longer be used as the primary URL and will redirect visitors. The destination URL field specifies the current page that matches the old URL in content and should accept users and search engine crawlers.

Before creating a rule, you should manually check the final URL, as it must exist and open correctly. If the new URL returns a 404 error, leads to a different redirect, or contains invalid GET parameters, the rule itself will not fix the problem.

How to create a 301 redirect?

To create a 301 redirect, first add the old and new addresses to the corresponding fields in the generator, then select the rule format for your server. After generating, copy the code, enter it into the configuration, and be sure to check the result using an HTTP response or redirect chain testing tool.

It is better to keep the sequence of actions the same even for several dozen addresses:

  1. Specify the old URL that you want to decommission and redirect to the current address.
  2. Add a new URL that best matches the old page in purpose and content.
  3. Select the rule format for Apache, Nginx, or another available environment.
  4. Generate code and check each match before transferring to the production site.
  5. After installation, verify that the source address returns 301 and the destination address responds with 200.

This type of check is especially necessary during mass migrations, where a single template error can affect a large section of the site. Pages with URL parameters, UTM tags, and non-standard request processing rules should be checked separately.

One URL

For a single page, a simple mapping between the old and new URLs is used, for example, /old-page/ → /new-page/. This approach is suitable after changing the friendly URL, moving content to another section, or merging two related pages, when the old URL should no longer be indexed separately.

After implementation, it's important to open the original URL and ensure the browser directly navigates to the desired page. If another intermediate URL appears between the old and final URLs, this creates an unnecessary redirect chain that should be eliminated.

Bulk URL List

When performing a mass migration, it's more convenient to work with a match list, where each old page has its own new URL. This format reduces the risk of accidentally sending a large set of different pages to a single, shared URL and helps maintain a logical navigation structure.

The list typically uses the "old URL → new URL" scheme, with one pair per line. Before publishing, check for duplicates, empty lines, matches between the old and new URLs, and pages already redirected by other rules.

When is a 301 redirect needed?

A permanent redirect is used in situations where the old address should no longer remain a standalone page and its traffic should be redirected to the current URL. The main goal is to maintain a clear path for users and search engines after the resource structure has changed.

301 Moved Permanently should only be used for permanent changes. If the page is temporarily unavailable or the move is for a limited period, you should first check whether a permanent HTTP code is appropriate for this scenario.

Changing the page URL

After changing the friendly URL, don't leave the old URL with a 404 error if it already has internal links, external links, or is indexed. A permanent redirect connects the old URL to the new one and gives search engines a clear signal about the change.

The new URL should match the content of the old page, not simply point to the same section of the site. The more accurately the correspondence between documents is maintained, the fewer problems will arise during crawling and subsequent indexing.

Moving a website to a new domain

When changing a domain, it's a good idea to prepare a table of mappings between old and new addresses in advance. If the structure is preserved, rules can be built according to the same logic, but critical pages should still be checked separately after launch.

Redirecting all old URLs to the homepage is generally not recommended, as different documents have different meanings and search histories. It's best to redirect the old page to the most similar new document, or to delete it gracefully if there truly is no suitable alternative.

Migrating from HTTP to HTTPS

After installing SSL, the site should use a single, secure primary URL, and HTTP requests should be redirected to the corresponding HTTPS pages. The path and URL parameters should be preserved if they are required for the page to function correctly.

After setting up, you should check your homepage, categories, content, parameter pages, and technical URLs. You should also ensure that the canonical, sitemap.xml, and internal links already contain HTTPS and don't continue to redirect.

WWW or without WWW

For SEO purposes, there's no universal advantage to using the www or non-www version, so choose one primary version and use it consistently. The alternative version of the domain should redirect directly to the corresponding page on the primary domain.

A scheme where www is first redirected to HTTP without www, and then separately to HTTPS is unacceptable. A single direct route that immediately leads the user and search engine crawler to the final canonical version of the URL is much cleaner.

Changing the site structure

A 301 is often required after moving sections, changing directory nesting, merging pages, or migrating to another CMS. In such projects, it's especially important to map old and new URLs in advance and then check for any unassigned URLs.

After running the migration, monitor 404 errors, old page requests, and the appearance of chains. This data allows you to quickly identify forgotten URLs and add missing rules without rebuilding the entire structure.

Common mistakes when creating 301 redirects

Errors in persistent redirects often go unnoticed because the user still ends up on a page. For SEO, precise document matching, the absence of unnecessary transitions, and consistent canonical logic, internal links, and sitemaps are crucial.

Before launching a bulk list, it's helpful to test a small sample manually, then test the entire set automatically. This approach quickly detects system errors before they affect hundreds or thousands of URLs.

01

Using 302 instead of 301

302 is a temporary redirect, so it shouldn't be used to permanently change a page's address just for a quick fix. If the page is being moved permanently, the HTTP response type should reflect the permanent nature of the change.

When auditing, it's helpful to check the response code separately from the final URL. Two different redirects may open the same page in the browser, but their intended purpose for the search engine is different.

02

Redirect all URLs to the home page

After moving a website, people sometimes try to redirect every old page to the new homepage because this rule is easier to set up. However, this results in a loss of consistency between documents, and the user ends up on a generic page instead of the desired product, article, or section.

For each important old page, it's best to find the closest new URL. If there's no relevant replacement, the decision should be made separately, rather than using the home page as a universal final URL.

03

Long redirect chains

Chains occur after multiple URL changes, when a new rule is added on top of the previous one and old matches are not updated. After several migrations, a single request may pass through two, three, or more intermediate URLs.

After each change, you should review the original rules and redirect old URLs directly to the current final URL. At the same time, you should update internal links so that your own site doesn't access intermediate versions at all.

04

Redirect to error page

A redirect is considered incorrectly configured if the final URL returns a 404, 5xx, or other unexpected code. You should check not only the 301 itself, but also the final page response after the entire route is completed.

This error often occurs after repeated page deletion, a new structure change, or a typo in the mapping table. A mass automated check helps quickly identify such cases among a large list of URLs.

05

Loss of GET parameters

Some pages use URL parameters for filtering, analytics, advertising tags, or other logic, so they can't be automatically considered unnecessary during migration. The rule should retain necessary GET parameters or intentionally remove them according to a predefined pattern.

UTM parameters, filter parameters, and system identifiers require special attention. After implementation, test several example requests with parameters to ensure the final page receives the expected values.

06

.htaccess rule conflict

The order of .htaccess rules affects which condition is matched first and whether the request is forwarded. A general domain, protocol, or directory rule can intercept a URL before a more specific redirect.

If you encounter any issues, you should check RewriteCond, RewriteRule, flags, and the new block's location relative to the existing configuration. It's best to make changes in small increments, saving a working copy of the file before each major update.

What we actually did

Dental clinic · Kyiv and Chernihiv

+44% clicks from search

A domain with no history on a website builder. We built the semantic core for both cities, reworked the landing pages and built the link profile from zero. Four months: 34.8k clicks, impressions 1.32 → 1.76M, DR 0 → 41.

E-commerce · international

+96% clicks in two months

A catalog of digital 3D models. We clustered the semantics, rebuilt the hub pages and closed duplicates and indexing errors. Google users 247 → 532, CTR 2.4% → 4%.

Medical center · Ukraine

+68.75% visibility in the first month

Narrow visibility and a small semantic core at the start. Semantics, landing page structure, metadata and internal linking, then gradual link building.

Answers to your questions

Is it possible to create a 301 redirect without knowing .htaccess?

Yes, the generator can create a ready-made rule based on the entered addresses, so manually writing the syntax for each simple transfer is not required. The user still needs to understand where the server configuration is located and what code format is appropriate for their project.

After implementation, the rule must be verified using the HTTP code and final URL. Automatic generation reduces the risk of syntax errors, but does not determine for the user whether the selected new page is correct.

What is the difference between 301 and 302 redirects?

301 indicates a permanent address change, while 302 is used for a temporary redirect. Both options can visually open the same page, so it's the HTTP response code that should be checked.

If the old URL is no longer intended to be used as the primary URL, a permanent migration is typically chosen. For a short-term route change, it's important to first evaluate whether the temporary code is suitable.

Where to insert the 301 redirect code?

On Apache, the code is often added to .htaccess, while on Nginx, the appropriate server block or other section of the server configuration is used. The specific location depends on the site's architecture and existing rules.

Before making any changes, it's a good idea to save a backup and test the current configuration. After adding a redirect, test the source page, the destination URL, and several adjacent URLs.

Is it possible to create a 301 redirect for multiple URLs at once?

Yes, if the generator supports bulk processing of matches between old and new addresses. Typically, each pair is added as a separate line, after which the service generates a ready-made set of rules.

Before importing or copying the result, remove duplicates and check page consistency. An error in a bulk template can affect a large number of URLs simultaneously.

How to check if 301 redirect is working correctly?

First, check the HTTP status code of the source URL, which should return a 301 response for a permanent transfer. Then, ensure that the destination URL opens directly and normally responds with a 200 status code.

Additionally, check the entire navigation chain, as there may be another redirect hidden between the old and new pages. For large lists, it's more convenient to perform this check in bulk.

What is better: a redirect from www to non-www or vice versa?

There's no universally best option for SEO, so you should choose one primary domain version and use it consistently. The alternate version should link directly to the corresponding URL of the primary version.

At the same time, you should check your canonical, sitemap.xml, and internal links. They shouldn't continue to use a domain that redirects to a different version each time.

Do I need to change internal links after installing 301?

Yes, it's best to update internal links directly to their final URLs, as the site owner has direct control over their own interlinking. A permanent redirect should be left for old external links, bookmarks, and URLs already known to search engines.

This approach reduces the number of intermediate requests and prevents the creation of new redirect chains. After the migration, it's a good idea to scan the site and find any remaining links to the old URLs.

Is it possible to remove a 301 redirect after moving a website?

You shouldn't delete the rules immediately after moving, as the old URLs may still remain in the search index, external links, and user bookmarks. How long redirects remain in place depends on the project, URL history, and external traffic sources.

Before deleting, check for hits to old URLs and ensure all managed links have been updated. For valuable pages, persistent rules are often retained for a long time unless they cause technical issues.

A 301 redirect generator reduces manual work when changing URLs, migrating sites, and setting up permanent redirects. Achieving the correct result requires three steps: creating an exact match between the old and new URLs, setting the rule to the appropriate configuration, and verifying the full route to the final page.

Specify the old and new URLs, create a ready-made rule, and test it before publishing it to the live site. After implementation, update internal links, canonical, sitemap.xml, and hreflang to ensure the site structure immediately uses the final URLs.

We reply within one business day. No newsletters, no “just a reminder” calls.

Gennadii, Lead SEO Specialist, Seo-Gen
He will look at the site himself instead of passing it to a manager.
Who will answer: Gennadii
Lead SEO Specialist, Seo-Gen

More on: 301 redirect generator

What redirect rules can be generated?

The redirect syntax depends on which server is running the site and where its configuration is located. Apache often uses the .htaccess file, while Nginx uses its own directives within configuration blocks, so the same code can't be transferred between different servers without testing.

A redirect rule generator should generate a clear rule for a specific scenario, rather than mixing multiple syntaxes in a single block. Before implementing, it's important to understand exactly where the code will run, as an incorrect directive can cause a redirect loop or make part of the site inaccessible.

301 redirect for Apache and .htaccess

On Apache-based websites, permanent redirects are often configured via .htaccess, located in the root directory of the website or a separate section. Before making any changes to the file, it's a good idea to save a backup copy so you can quickly revert to a working version if an error occurs in RewriteRule, RewriteCond, or another rule.

If the site already uses CMS, HTTPS, www, and URL canonicalization rules, the new code must be placed taking into account the existing processing order. An overly broad condition may intercept the request before the required rule and send the page to the wrong final URL.

Redirect 301

The 301 Redirect directive is suitable for simple permanent relocations, where the specific source URL and the specific new page are known in advance. This option is easier to read and verify, so it is often used for a small number of targeted URL changes.

When a large number of complex conditions arise, a simple directive may not be sufficient. In this case, mod_rewrite rules are used, which take into account the path, domain, protocol, and additional conditions for request processing.

RewriteRule and RewriteCond

RewriteRule specifies the URL processing pattern and redirection direction, while RewriteCond adds the condition under which the rule should be triggered. This combination is used for switching from HTTP to HTTPS, changing from www to non-www, processing URL groups, and other scenarios where an exact match is not sufficient.

Regular expressions require particularly careful checking, as an overly broad pattern can affect more pages than intended. After changing the configuration, check multiple URLs within and outside the desired section to prevent accidental capture of adjacent URLs.

301 redirect for Nginx

In Nginx, rules are typically added to the corresponding server configuration block, after which the configuration is tested before restarting the server. This approach reduces the risk of applying a file with a syntax error and causing a problem for the entire domain.

When setting up, consider existing HTTPS rules, the primary domain, proxying, and path handling. If multiple domains or subdomains are configured on the server, the redirect must be placed in the block that receives the original request.

return 301

The return 301 directive is suitable for clear, permanent redirects where the condition is already defined by the selected server block or location. This code is typically shorter than complex rewrite constructs and is convenient for scenarios where the protocol, domain, or known path changes.

When using a full new address, check the protocol, domain, path, and the presence of the required final slash. Even a short rule should be tested on several URLs, especially if it applies to an entire section of the site.

Bulk rules and map

For large numbers of matches, Nginx can use a structured list or map if this scheme suits the project configuration. This is more convenient than a long set of nearly identical conditions and simplifies subsequent handling of mass redirects.

Before deployment, the list should be cleared of duplicates and verified to ensure that each old address has a single, clear final URL. For complex migrations, it's helpful to store the mapping table separately from the server configuration in advance so it can be verified and reused.

How is 301 different from 302, 307 and 308?

Different HTTP redirect codes communicate different aspects of the URL change to the browser and search engine. 301 or 308 are typically used for permanent URL changes, while 302 and 307 are intended for temporary scenarios and should not automatically replace a permanent redirect.

It is convenient to check the main differences in the table before creating a rule:

CodePurposeTypical scenario
301Permanent redirectionChange URL, domain, structure
302Temporary redirectionTemporary page replacement
307Temporary redirect with method preservationTemporal technical logic
308Permanent redirect with method preservationConstant transfer with preservation of method

The code selection should reflect the actual duration of the change, not the ease of setup. If the URL is changing permanently, a temporary redirect creates a less clear signal and complicates subsequent technical support.

301 Moved Permanently

The 301 code indicates that the resource has been permanently moved to a different URL and the old address is no longer considered the primary access point. It is used when changing the structure, domain, protocol, or other permanent changes.

After installation, you should update your internal links so they immediately point to the new address. A permanent redirect is necessary for external requests to the old URL, but within the site, it's better to use direct links without unnecessary redirects.

302 Found

The 302 code is used when the redirect is temporary and the original URL remains valid. This option can be used for short-term page replacement, route testing, or temporary technical setup.

Don't use 302 instead of 301 just because the visitor is visually directed to the correct page. For search engines, the response type has a separate meaning and should correspond to the actual purpose of the redirect.

307 Temporary Redirect

307 denotes a temporary move and preserves the HTTP request method, which is important for technical scenarios involving POST and other methods. This code is typically not used for regular, permanent changes to a page's address.

Before choosing 307, it's important to understand why temporary logic and method preservation are required. Standard SEO page migrations more often use a regular permanent redirect with a pre-prepared URL mapping.

308 Permanent Redirect

308 denotes a permanent migration and preserves the request method, so it technically differs from the classic 301 in certain scenarios. For regular website pages, 301 is more common, as it has long been used in standard SEO migrations and is well supported by the infrastructure.

There's no need to choose 308 just for the sake of a newer codebase. The decision depends on the server logic and the nature of the requests, which must retain the original HTTP method after redirection.

How does a 301 redirect affect SEO?

A permanent redirect helps search engines associate the old address with the new one after changing the site structure. If the migration is successful, the robot receives a clear route, and users, external links, and old bookmarks continue to open the current page instead of the 404 error.

A redirect alone isn't enough for a clean migration, as old URLs may remain within the site. After the migration, you need to adjust the canonical, sitemap.xml, hreflang, navigation, and internal links to the final URL structure.

Signaling to a new URL

301 signals the search engine that the new URL is now considered the primary address of the document. This signal helps unify the history of the old and new pages, but it cannot guarantee automatic retention of all rankings or the complete transmission of any accumulated signals.

The outcome depends on page alignment, migration quality, accessibility of the new document, and the absence of technical errors. Moving to an irrelevant URL, long redirect chains, or redirecting pages en masse to the homepage will degrade migration quality.

What needs to be updated after the transfer?

After setting up server-side rules, remove old URLs from elements managed by the site itself. The internal structure should immediately reference the final URLs so that search engines don't have to go through an intermediate HTTP response each time.

After migration, please check the following items:

  • Internal links should point directly to the new URL without an intermediate permanent redirect.
  • Canonical should point to the current canonical URL of the page, not to an old version.
  • The sitemap.xml must contain final indexable URLs that return a normal response code.
  • Hreflang should use current addresses for all language and regional versions of the page.
  • Navigation, breadcrumbs, and links from templates should be updated at the same time as the main pages.

After these changes, redirects continue to accept external requests to the old addresses, but the internal architecture now operates directly. This approach simplifies site crawling and reduces unnecessary requests through old URLs.

Why can't you leave old URLs inside the site?

If internal links continue to point to the old address, each transition creates an additional request and forces the robot to go through a 301. With several successive changes to the structure, such links can easily form long redirect chains.

The old address is needed for external sources, bookmarks, and already indexed pages that can't be updated manually. It's best to replace links within your own website immediately, as the owner has complete control over them.

How to install the generated redirect code?

Once generated, the code must be placed where the server or CMS processes requests to the old address. The implementation method depends on the site's infrastructure, so don't add an Apache rule to the Nginx configuration or copy the code between different systems without checking the syntax.

Before making changes, you should save a backup of the working configuration and record which rules you're adding. This is especially useful during mass migrations, when you need to verify the origin of a specific redirect several weeks later.

Where to insert a rule in Apache?

In Apache projects, rules are often placed in the .htaccess file, which is located in the root of the website or a specific directory. If the file already contains CMS, security, HTTPS, and other RewriteRule directives, the new rule must be inserted in the correct order.

After saving, check the original URL, several adjacent pages, and a URL that shouldn't match the new condition at all. This check helps quickly detect overly broad regular expressions or conflicts with an existing rule.

Where to insert a rule in Nginx?

In Nginx, the code is placed in the appropriate server block or other configuration section that handles the initial request. Before reloading, the configuration must be checked using standard server tools to ensure that a syntax error does not affect website availability.

After application, check the domain, protocol, multiple paths, and final address. If the transfer involves a large section, additionally check pages with parameters, files, and technical URLs that may have accidentally been affected by the general condition.

Is it possible to set up a redirect via CMS?

Many CMSs allow you to manage persistent redirects through a built-in module or a separate plugin, so directly editing the server file isn't always necessary. This method is convenient for site managers who need to add specific rules without access to the server configuration.

WordPress and other popular systems offer import, export, 404 logging, and bulk URL management features. Even with a large number of rules, performance, existing server configuration, and possible duplicate redirects at different levels still need to be considered.

How to test 301 redirect after setup?

Post-implementation testing is essential because the browser may visually open the desired page even after several intermediate transitions. For SEO and technical clarity, the full request path, including every HTTP code and final URL, is essential.

The normal scheme for a permanent transfer looks like this:

Old URL → 301 → New URL → 200

The problematic diagram looks different:

Old URL → 301 → Intermediate URL → 301 → New URL → 200

The shorter the route, the easier it is to maintain and verify. After a mass migration, it's useful to download all old addresses and automatically check the response codes in a list.

Check the response code

The original URL should return an HTTP 301 status code if the redirect is truly permanent. Checking the page's visual appearance alone isn't enough, as the user will see a similar result with a 302, 307, or a chain of multiple redirects.

The final URL should typically return a 200 status code and open the relevant document. If the final page itself redirects, you should determine the final address and, if possible, point the old URL directly to it.

Check the final address

After setting it up, make sure the old URL points to the page that matches its original purpose. A single letter, category, or parameter error can redirect traffic to a technically valid but thematically inappropriate document.

Pages with similar names and mass lookup tables are checked especially carefully. For large numbers of rows, it's helpful to compare the old and new URLs along with the page name or other identifier.

Check the redirect chain

A redirect chain occurs when a source URL passes through several successive redirects before reaching the final page. This pattern often occurs after several migrations, when a new rule is added on top of an old one without re-evaluating previous matches.

If URL A points to URL B, which then redirects to URL C, it's best to change the first rule and direct URL A directly to URL C. This shortens the route, reduces the number of requests, and simplifies future site maintenance.

Check the redirect loop

A redirect loop occurs when a rule returns a request to the original URL or when multiple rules redirect a URL to each other. As a result, the browser cannot open the page and stops navigating after a series of repeated requests.

Most often, a loop occurs due to conflicts between HTTPS, www, general domain rules, and individual RewriteRules. After changing these conditions, you should separately check both domain versions, both protocols, and several typical site pages.

English names of redirect generators

English-language SEO services may refer to the same type of tool differently, as some names emphasize the code, while others emphasize the rules or the URL itself. Commonly used search terms include "301 redirect code generator", "301 redirect generator", "301 redirect maker", "redirect generator", and "redirect generator online".

For more technical purposes, the terms "redirect rule generator" and "url redirect generator" are also used. Regardless of the name, the user expects the same basic functionality: specify the old and new addresses, receive a ready-made rule, and test it before implementation.