301 Redirect Generator Tool

Select redirect type:

If you want to redirect your www site to a non-www site or vice versa, setting up a redirection is the easiest way to do that.

There are many types of redirection, but 301 is the most preferred type of redirection in the case of a site moving permanently.

A simple file with a .htaccess extension can be used to set up the 301 redirections for every URL of your site. The 301 Redirect Generator tool can generate the code to put the .htaccess file in order to set up permanent redirection.

FREE 301 Redirect Generator:

The 301 redirect generator is a utility tool that you can use to set up 301 redirects on your site. With this tool, you can set up two types of redirection: www to non-www and non-www to www redirection.

Our tool takes a couple of inputs from the user and generates the code on the basis of the inputs.

Instruction on how to use the 301 redirect generator tool:

→ To use our Htaccess Redirect Generator, you first need to copy the name of the domain for which you’ll set up the redirection.

→ After the domain name is copied, paste the domain name into our tool.

→ Now you will have to select the redirection type. In other words, you will have to specify whether you are going to redirect your website from www to your non-www website or non-www website to www website.

→ Now log into your hosting and locate the .htaccess file. If you are using a hosting service to hot your site, open the folder or the directory in which you have kept the .htaccess file. For most websites, you’ll find the .htaccess file in the root directory of the website.

→ Open the file using any text editor and paste the code. You can also download the .htaccess file, merge the previous text contents (if any) with the generated code, delete the previous .htaccess file and upload the new file containing the code you’ve just generated using the 301 Redirect Generator tool.

Now your website will be redirected according to your code.

Example of two kinds of redirection:

A www to non-www redirection:

If your website is using www, the tool can help to redirect your www URLs to plain (non-www) URLs.

For example: www.example.com will be redirected to example.com

A non-www redirection to www:

If your website is currently using non-www URLs, you can utilize the URL Redirect Generator tool to automatically redirect these to their www counterparts.

For example: example.com will be redirected to www.example.com

Importance of redirection:

Setting up redirections to your new website is very crucial in order to display all the pages correctly after making some major changes, in our case shifting your www URLs to non-www or vice versa.

  • Firstly, the 301 redirection helps to prevent a critical error named a “broken link error”. Normally, if you don’t set up redirections properly, the users who are visiting your website using the previous link structure will get a 404 error on every page of your website. This becomes frustrating and will force the visitor to eventually exit the website, increasing bounce rate.

Search engines too will face the error and it may cause the pages of your website to get de-indexed from Google. If you don’t set up redirection even after a while, it may even cause your whole website to get de-indexed from search engines.

  • Secondly, redirections like a 301 redirection do not affect the link's health and ranking. For example, If one of the pages of your www-enabled site is ranking well on the search engine results page and you set up a 301 redirection to the non-www URL, the URL will continue to rank on top.

Frequently asked questions about the Htaccess 301 Redirect Generator:

  1. What kind of server is the htaccess redirection code applicable for?

Ans: The 301 htaccess redirected is supported for Apache servers only, other servers use different kinds of redirection code.

  1. What are the difference between 301 and 302 redirection?

Ans: The 301 redirection is used to signal a permanent redirection while the 302 redirection is used to signal that your website is moving to a new URL temporarily.


Farhan Ahmed

Marketing & Growth

Hi there! I am Farhan A marketing nerd with the hands on knowledge of scaling a brand from 0 to 1 with SEO, Performance marketing and Growth hacking.