Online 301 Redirect Code Generator

Online Web Code Test | Online Image Picker | Online Color Picker

301 Redirect Code Generator

Use permanent 301 redirect to preserve search engines rank.

The code generator supports web pages redirection of html, php, asp, aspx files and .htaccess redirect.

Redirect geneartor

Enter URL of old page:

Enter URL of new page:

Select redirect type:


Generated redirect code to replace old page code:

Click on code to copy text to replace old URL page file with redirection code.

Where to put redirect code

Redirect code
not changed not changed old page on same server
not changed changed old page on new server
changed not changed old page on same server
changed changed old page on old server

* Only with .htaccess redirect: add redirect code to httpd.conf file or to .htaccess file.

Redirect options

Redirect type Redirect side Old page
file type
Old URL server type Is permanent
301 redirect?
PHP Server-side .php Apache / Linux yes
ASP Server-side .asp IIS / Windows yes
ASP.NET Server-side .aspx IIS / Windows yes
Apache .htaccess Server-side all Apache / Linux yes
IIS web.config Server-side all IIS / Windows yes
HTML meta tag Client-side .html all no
Javascript Client-side .html all no
jQuery Client-side .html all no

What is the 301 redirect?

It is special information (code) sent to the browser or search bot by your server on a certain page visit. The code means moved permanently.

How to choose a right generator for a permanent redirect?

If your server is Apache and You have access to the configuaration file You may need to choose RewriteRule or RedirectMatch generators. Use RedirectMatch generator only if already have a lot of such redirects you need to keep. In case You have access to PHP files only You can choose our PHP generator.

Why should I use redirections?

To keep your site searchable by search engines like Google you need to apply 301 redirect to old pages after url change. Without this information search bots can't understand (in most of the cases) that page url was changed, but the content is the same and valuable for to be visible in search results. If your income depends on organic search, there is a very special reason to do redirects in the right way. So, if you decided to change your domain or just rename page url you need to make redirects. One of our code generation tools may help you in such situations.

When should I apply a permanent redirect?

1. You decided to change url for some page to make it more relevant to page content for a better user experience. - You need redirect from old url to new url.

2. You deleted some page and created a new page with similar content. - You may need to make such redirect to keep PageRank and positions in search.

3. You replaced the whole site with a newly built one and you have a new url structure. You will need to do mass redirects. Bulk redirect generators will help with this task.

"Redirect" vs "RewriteRule"

If You already have Apache redirect code like Redirect 301 "/old" "", note that these rules are handled with "mod_alias", but not "mod_rewrite". While both modules can do permanent redirects, "mod_rewrite" is more functional. Mod_rewrite will make rewrite system more flexible and can help you in the future. For example, "mod_alias" can't fully handle query strings. These Apache modules have separate flow and Redirect rules can conflict with Your new "mod_rewrite" rules. Also, be careful, because the rule works on a directory basis and all files inside directories and subdirectories will be redirected too. So, If you need to use batch online redirect generator and you have a small amount of Redirect 301 rules, we can recommend rewriting these rules with "mod_rewrite" functionality to keep the logic clean. For simple redirects and some heavy load enterprise solutions, mod_alias can be a good choice too.


Maybe, most popular server for WordPress is Apache. While many SEO plugins provide a possibility to add and manage PHP redirects in WordPress admin panel, we can't suggest using permanent redirect WordPress plugins because Apache redirects are much faster and, therefore, better for user experience and for SEO in many cases. Some plugins can work with Apache configuration file directly, but it is a less secure approach, so, better to use other methods.


Online Calculators

Online Web Code Test | Online Image Picker | Online Color Picker

Online Calculators