Create redirect rules for Apache (.htaccess) or Nginx: page-to-page 301 redirects, forcing HTTPS, and choosing www or non-www.

Loading the tool…

Redirect types

Code Meaning Use for
301 Moved permanently Changed URLs, site moves, HTTPS
302 Found (temporary) Short-term changes, A/B tests
308 Permanent, keeps method APIs and forms that must stay POST

For SEO, use 301 (or 308) for permanent changes so search engines transfer the old page’s signals to the new one.

Example .htaccess

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]

Redirect 301 /old-page/ /new-page/

Before you upload

Frequently asked questions

Where is the .htaccess file?

In your website’s root folder (often public_html). It may be hidden, so turn on “show hidden files”.

Does .htaccess work on Nginx?

No. Choose Nginx to get server block rules instead.

How long should I keep redirects?

Google suggests at least a year; keeping them permanently is safest.

Can WordPress do redirects without .htaccess?

Yes, with a redirection plugin, but server rules are faster.

Sources

Last updated: