Support 24/7 Service status
Hosting
Email
Discounts
Help
Company
Sign in Support 24/7
Get started

Redirecting a page or a whole website

Send visitors from an old page to a new one, or from one domain to another, with a 301 redirect in DirectAdmin or your .htaccess file, without losing your search rankings.

Updated 21 November 2026

A redirect sends anyone who opens one address to another, automatically. Use one whenever a page moves or is renamed, so old links, bookmarks and search results still work.

301 or 302? Use 301 (permanent) for nearly everything: it tells search engines the page has moved for good, and its rankings move with it. Use 302 (temporary) only for short-lived changes, like a page that's down for a week.

The easy way: DirectAdmin

  1. Open DirectAdmin from your service page (one-click login).
  2. Go to Account Manager → Site Redirection.
  3. Choose Create new redirect: enter the old path (like /old-page), choose 301, and the full new address (like https://example.com/new-page).

With your .htaccess file

For more control, add redirect rules to the .htaccess file in your site's public_html folder. Open it with File Manager (see Uploading your website). It may be hidden: turn on showing hidden files if you don't see it. Put your rules at the top.

One page to another:

Redirect 301 /old-page/ https://example.com/new-page/

A whole folder (everything under /blog/ to the same addresses under /news/):

RedirectMatch 301 ^/blog/(.*)$ https://example.com/news/$1

A whole site to a new domain, keeping each page's path:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com$ [NC]
RewriteRule ^(.*)$ https://new-domain.com/$1 [R=301,L]

www to the bare domain (or swap them round for the opposite):

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

To send everyone to https://, use Force SSL in DirectAdmin instead: see Free SSL certificates.

On WordPress, keep your rules above the # BEGIN WordPress line, or use a redirect plugin instead, so WordPress doesn't overwrite them.

Another domain showing the same site

If you own several domains, like .com and .co.uk, you can add the extra ones to your account and redirect them to your main site: see Adding subdomains and extra domains.

Checking it works

Open the old address in a private browser window: it should land on the new one. Browsers remember 301 redirects, so if you change one, test in a new private window.

Site stopped working after an edit? A mistake in .htaccess causes a "500 Internal Server Error". Undo your change, or rename the file to .htaccess-old, and check the rule again. Open a ticket if you'd like us to check it for you.

Still stuck?

Open a ticket and a real person will help you, any time of day.

Open a ticket Other ways to reach us

Ready to go live?

Pick a plan in a minute and your site's ready shortly after.

Get started