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.

Enter the path part (e.g., /about-us) or full old URL.

Ensure RewriteEngine On exists once above these rules in your .htaccess file.

How to Use This Tool

How to Generate .htaccess Redirect Rules

  1. 1

    Select the type of redirect you need from the dropdown.

  2. 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. 3

    For 'Force HTTPS', 'WWW to Non-WWW', or 'Non-WWW to WWW', enter your 'Domain Name' (e.g., yourdomain.com).

  4. 4

    The corresponding `.htaccess` rule will be generated automatically in the text area below.

  5. 5

    Click the copy icon (<Copy />) to copy the generated rule.

  6. 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. 7

    Warning: Incorrect `.htaccess` rules can break your website. Test thoroughly after making changes.

Cookie Settings

We use cookies to enhance your experience and analyze site traffic. By clicking "Accept All", you consent to our use of cookies.

Privacy Preferences

We and our partners share information on your use of this website to help improve your experience. For more information, or to opt out click the Do Not Sell My Information button below.