Free online Htaccess Redirect Generator generate content or data quickly.
The free online Htaccess Redirect Generator will help you create placeholder content or secure passwords.
Ensure RewriteEngine On
exists once above these rules in your .htaccess file.
How to Generate .htaccess Redirect Rules
- 1
Select the type of redirect you need from the dropdown.
- 2
For '301 (Permanent)' or '302 (Temporary)' redirects, enter the 'Old URL Path' (e.g., /old-page.html) and the full 'New URL' (e.g., https://yourdomain.com/new-page).
- 3
For 'Force HTTPS', 'WWW to Non-WWW', or 'Non-WWW to WWW', enter your 'Domain Name' (e.g., yourdomain.com).
- 4
The corresponding `.htaccess` rule will be generated automatically in the text area below.
- 5
Click the copy icon (<Copy />) to copy the generated rule.
- 6
Paste the generated rule into your `.htaccess` file located in your website's root directory. Ensure `RewriteEngine On` is present (usually only once near the top).
- 7
Warning: Incorrect `.htaccess` rules can break your website. Test thoroughly after making changes.