Generated Code
.htaccess file located in your website's root directory (usually public_html).
Create safe, SEO-friendly redirect rules for your Apache server.
.htaccess file located in your website's root directory (usually public_html).
The .htaccess file is a powerful configuration file used by Apache web servers. It allows you to control how your server responds to requests, enabling functionality like redirects, security restrictions, and URL rewriting. However, writing the correct syntax manually can be risky; a single typo can take down your entire website (Error 500).
This tool generates the exact code you need for the most common tasks without requiring you to learn Apache syntax (RegEx). Whether you are migrating a page to a new URL, securing your site with SSL, or fixing canonical domain issues, this tool has you covered.
http://, they are automatically sent to the secure https:// version.Copy the generated code and paste it into the .htaccess file located in your website's root folder (often named public_html or www). If the file doesn't exist, you can create a text file named exactly .htaccess (the dot is important).
Ensure that RewriteEngine On is present at the top of your file (our tool includes this for complex rules). Also, browsers cache redirects aggressively. Test your changes in an Incognito/Private window to see the immediate effect.
Yes. You can paste multiple Redirect 301 lines one after another in your file. For example:
Redirect 301 /old-page.html /new-page.html Redirect 301 /services.html /products.html