.htaccess

.htaccess Redirect Generator (301)

Choose the redirects you need and paste a list of old and new URLs to create the .htaccess rules for an Apache server. 301 redirects pass visitors and search engines from old pages to the new ones, so you keep your search rankings and bookmarks after a site move.

Basic settings
Old URL → new URL
Move the whole site to a new domain (optional)

.htaccess

    The file is downloaded as htaccess.txt. Rename it to .htaccess after uploading it to the server.

    Before you upload

    • Back up (download) your current .htaccess first. A single mistake can make the whole site show a 500 error; if that happens, put the backup back.
    • Add the rules to the top of your existing .htaccess, above “# BEGIN WordPress”. Anything written inside the WordPress block is erased when WordPress saves its settings.
    • .htaccess works only on Apache (and compatible) servers such as most shared hosting. It does not work on nginx; ask your hosting company or server administrator instead.
    • Browsers remember 301 redirects. Test in a private window, and check the result with the Redirect Checker.
    Open the Redirect Checker
    • 301 means “moved permanently”. Search engines move the old page's evaluation to the new URL over time. Keep the redirects for at least one year, ideally permanently.
    • With RewriteRule, a trailing slash on the old URL is optional (/about/ also matches /about). Redirect 301 also redirects every URL that starts with the old path.
    • Everything is created in your browser. Nothing you enter is sent or saved.

    About this tool

    Create the .htaccess rules for 301 redirects when you move or renew a website, just by choosing options and pasting URLs. Redirect http to https, choose www or non-www, send /index.html to /, and convert a list of old and new URLs pasted from Excel or Google Sheets. Choose between RewriteRule and Redirect 301, or send the whole site to a new domain. Everything is created in your browser.

    How to use

    1. Under Basic settings, choose the redirects you need: http to https, www or non-www, and /index.html to /. Entering your domain combines them into a single redirect.
    2. Under Old URL → new URL, enter one pair per line. You can paste two columns straight from a spreadsheet.
    3. Choose the Format: RewriteRule (recommended) or Redirect 301. If the whole site is moving, also enter the New domain.
    4. Copy or download the rules from the .htaccess box.
    5. Back up your current .htaccess, add the rules at the top (above “# BEGIN WordPress”), then test in a private window and with the Redirect Checker.

    Useful for

    • Page URLs are changing in a website renewal
    • Moving a whole site to a new domain
    • Both http and https, or www and non-www, versions of your pages load
    • Sending visitors from deleted pages to related new ones

    FAQ

    What is a 301 redirect?

    A redirect that says a page has moved permanently. It sends visitors and search engines from the old URL to the new one, and search engines gradually pass the old page's ranking signals to the new URL.

    Should I use RewriteRule or Redirect 301?

    RewriteRule, which matches exactly, is usually the better choice. Redirect 301 is simpler but also redirects every URL that starts with the old path and cannot match query strings.

    Does it work on nginx?

    No. .htaccess is for Apache and compatible servers. On nginx, ask your hosting company or server administrator.

    What happens if .htaccess has a mistake?

    A single typo can make the whole site show a 500 error. Always back up your current .htaccess first, and restore it if the site stops loading.

    How long should I keep the redirects?

    At least one year, ideally permanently, so visitors from old links and bookmarks still reach the new pages.

    Planning a site renewal or server move?

    We handle renewals and server moves including URL mapping, redirects, and checking search rankings and inquiries after launch.

    Ask about a renewal or server move
    Contact