Htaccess WWW Redirect Generator

Free SEO Tools

WWW Redirect Generator

1. Select redirect type

2. Enter your domain name

Do not include www. Domain name only - e.g.

3. Get your code

4. Copy the code to your .htaccess file

About WWW Redirect Generator and are considered as two different sites by Google and other search engines. The main domain is and any other names like are considered as a separate subdomains. Hence, you need to be careful and setup proper redirection between www and non- www versions of your site. Otherwise search engines will think the content is duplicated on two different sites and punish your domain for webspam.

Here is a free tool to generate a redirection directive between www and non-www versions of your site. Let us take an example that you have site with Now the first thing is you need to setup a preferred domain in Google Search Console account as Next, use our free tool to generate htaccess redirective from non-www to www version. Paste this code in your .htaccess file so that both the versions of your site will be redirected to the version.

How to Use Htaccess Redirect Tool? 

There are four steps in using this tool:

  1. Choose the redirect type either from www to non-www or from non-www to www.
  2. Enter your domain without www.
  3. Click on the "Get .htaccess Code" button.
  4. Copy the code and paste on your .htaccess file using FTP.

Check in browser that both www and non-www versions of your site are pointing to the correct site. Ensure to submit XML Sitemap for the correct version of your site in Google Search Console.

Related SEO Tools: