.htaccess Redirect Generator

Über .htaccess Redirect Generator

Our free .htaccess Redirect Generator creates the Apache RewriteEngine rules to permanently (301) redirect one version of your domain to the other - either www to non-www, or non-www to www. Just enter your domain name and copy the generated code.

1. Select redirect type





2. Geben Sie Ihren Domain-Namen ein


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

3. Get your code


4. Copy the code to your .htaccess file



Picking one canonical version of your domain and redirecting the other into it consolidates SEO ranking signals onto a single URL, instead of splitting them between two separate indexed versions of the same site.

Frequently asked questions

What does this .htaccess redirect actually do?

It generates the RewriteEngine rules to permanently (301) redirect every request from one version of your domain to the other - either www to non-www, or non-www to www - so visitors and search engines always land on a single, consistent URL.

Why does my domain need one canonical version?

Without a redirect, search engines can index both http://www.example.com and http://example.com as separate pages with duplicate content, which splits ranking signals. Picking one version and redirecting the other into it consolidates SEO value onto a single URL.

Where do I put the generated code?

Copy the code from the box above into the .htaccess file in your website's root directory (Apache servers only) - if the file doesn't exist yet, create a new plain-text file named exactly .htaccess.


Tools durchsuchen