• Follow
  • Follow
  • Follow


SYSTEM STATUS



1300 093 786

Domain Central Logo
  • Domain Names
    • Domain Registration
    • Domain Transfers
    • .au Direct
  • Web Hosting
    • WordPress Hosting
    • Plesk Hosting with SiteJet
    • Community Hosting
    • SSL Certificates
  • Email Solutions
    • Titan Mail
    • Microsoft 365
    • Office 365
  • Website Services
    • WordPress Maintenance and Support
    • Website Design
    • Ecommerce Shop Web Design
help Centre

Email

36
  • How to Archive IMAP Email Locally in Microsoft Outlook
  • How to Find and Provide Email Headers
  • Outlook Archiving Didn’t Reduce Email Storage (IMAP Accounts)
  • What is a DMARC Record and how do I create one: A Plain English Guide
  • Outlook
    • How to Archive IMAP Email Locally in Microsoft Outlook
    • How to Switch from the New Outlook to Classic Outlook on Windows
  • Microsoft 365
    • How to add a domain in Microsoft 365
    • How to add a user in Microsoft 365
    • How to configure email forwarders in Microsoft 365
    • How to change user permissions in Microsoft 365
    • Configuring 2FA in Microsoft 365
    • How to assign a license to a user in Microsoft 365
    • How to add/remove aliases in Microsoft 365
    • How to Create a User with Global Administrator Permissions in Microsoft 365
    • How to configure your Microsoft365 email account in Outlook
  • Smartermail
    • How to set up content filter rules for email accounts in SmarterMail
    • How to manage aliases in SmarterMail
    • How to configure Smartermail Email account on iPhone
    • How to change Mailbox Quota for SmarterMail account
    • What do I do when my SmarterMail Mailbox is Full?
    • How to purchase additional resources for your SmarterMail account
    • How to configure Smartermail Email account in Outlook & Mac Mail
    • Managing email accounts in SmarterMail
    • Password Changing in SmarterMail
    • How to configure Smartermail Email account on an Android device
    • How to enable Active Sync for your email in SmarterMail
    • Adding an image to your email signature in SmarterMail
    • How do I access the Smartermail Webmail Portal
  • Titan Mail
    • How to Log In to the Client Area and Set Up Your Titan Email Account
    • Download the Titan Mobile App
    • Setting up Titan on your iOS device
    • Setting up Titan on your Android device
    • Use Titan’s web version like a desktop app
    • How to setup an Email Alias in Titan
    • Creating and managing email signatures in Titan Mail
    • Configure Titan Mail in Microsoft Outlook

Domains

12
  • How to update WhoIs Information for a domain
  • How to setup an Email Domain Forwarder
  • How to setup a Domain Forwarder
  • How to Enable DNSSEC for Your Domain
  • .id.au Eligibility and Allocation
  • .asn.au Eligibility and Allocation
  • Eligibility & Allocation
    • .id.au Eligibility and Allocation
    • .asn.au Eligibility and Allocation
    • net.au Eligibility and Allocation
    • .org.au Eligibility and Allocation
    • .com.au Eligibility and Allocation
    • .au Direct Eligibility and Allocation

Error Codes

1
  • Outlook Error 0x800ccc0d or 0x800ccc0f

Getting Started

4
  • How to Log in to Plesk
  • Creating and Managing Support Tickets in the Client Area
  • How to login to the Client Area
  • Client Area vs. Control Panel; where do I go?

Web Hosting

44
  • Managing Your Website (Sites) in AdminBolt
  • How to Install WordPress in AdminBolt
  • How to Redirect a Page or Website Using .htaccess
  • How to Temporarily Point a Website to a Different IP Address Using the macOS Hosts File
  • How to Temporarily Point a Website to a Different IP Address Using the Windows Hosts File
  • How to purchase additional hosting resources
  • How to Create a DMARC Record in cPanel
  • Plesk
    • How to Remove a Subdomain in Plesk
    • How to Add a Subdomain in Plesk
    • How to Remove a Domain in Plesk
    • How to Add a New Domain in Plesk
    • How to Create a Database in Plesk
    • How to Check Disk and Bandwidth Usage in Plesk
    • How to Create a Directory or Files in Plesk File Manager
    • How to Upload Files via the Plesk File Manager
    • How to Change the Plesk Account’s Contact Details
    • How to Update a Plesk Account’s Email Address
    • How to Reset a Plesk Account Password
    • How to Change the Password of a Plesk Account
    • How to Log in to Plesk
    • How to Encrypt Database Password in Plesk Backup
    • How to Configure an FTP Backup in Plesk
    • How to Exclude Specific Files/Folders from the Plesk Backup
    • How to Generate a Full Backup in Plesk
    • How to Log In to Plesk and Enable AutoSSL
    • Using WP Toolkit in Plesk
  • WP Squared
    • Configure CDN on WP Squared
    • Add or Remove a Forwarding domain in WP Squared
    • How do I create a backup in WP Squared?
    • Using File Manager in WP Squared
    • Manage Files and Folders in WP Squared
    • Managing your website in WP Squared
    • How to Enable Two-Factor Authentication (2FA) in WP Squared
    • How to Disable or Reset Two-Factor Authentication (2FA) in WP Squared
    • How to Create a Staging Website Copy in WP Squared
    • How to Clear the NGINX Cache in WP Squared
    • How do I create my website in WP Squared?
    • How do I change/reset my WP Squared Hosting Password?
  • cPanel
    • How to Redirect a Page or Website Using .htaccess
    • How to Remove a CSR code in cPanel
    • How to Generate a Certificate Signing Request (CSR) in cPanel
    • How to Retrieve a CSR from cPanel
  • Admin Bolt
    • Managing Your Website (Sites) in AdminBolt
    • How to Install WordPress in AdminBolt

WordPress

22
  • How to Install WordPress in AdminBolt
  • Using WP Toolkit in Plesk
  • How to Change the WordPress User’s Display Name
  • How to Change the Password of a WordPress Account
  • How to Forcefully Update or Reinstall a WordPress Plugin
  • How to Delete Categories in WordPress
  • How to Delete an Uncategorised Category in WordPress
  • How to Add a New Category in WordPress
  • How to Bulk Delete Posts in WordPress
  • How to Remove a Post in WordPress
  • Simplifying Your Website’s Speed: A Step-by-Step Guide to Installing LiteSpeed Cache Plugin
  • Is LiteSpeed Cache Already Installed on Your WordPress Site? Here’s How to Check
  • How to Remove Sample Comments and Posts From WordPress
  • How to Deactivate and Delete a WordPress Plugin
  • How to Manually Install a WordPress Plugin
  • How to Delete a WordPress Theme
  • How to Manually Install a WordPress Theme
  • Litespeed WordPress Cache Plugin Configuration
  • How to Install a New WordPress Theme
  • How to Install a WordPress Plugin
  • How to Write and Publish Your First Blog Post in WordPress
  • How to Access the WordPress Admin Dashboard

DNS & Nameservers

1
  • How to add an SPF record for your domain from the client area

Transferring to Us

1
  • How to transfer your domain to Domain Central

Troubleshooting

7
  • How to perform a Traceroute
  • How to take a Screenshot for Support
  • How to Run a Traceroute to a Website from Your Computer
  • How to Let Our Support Team Access Your Windows 10 or 11 Computer Using Quick Assist
  • How to Clear the Browser Cache on Edge, Chrome, Safari, and Firefox
  • Is my website or the server down?
  • Outlook Archiving Didn’t Reduce Email Storage (IMAP Accounts)

Security

6
  • Has Your Email Address Been Pwned?
  • SSL Certificates
    • How to Log In to Plesk and Enable AutoSSL
    • How to Remove a CSR code in cPanel
    • How to Retrieve a CSR from cPanel
    • How to Generate a Certificate Signing Request (CSR) in cPanel
    • Do I need an SSL Certificate?
  • Home
  • Help
  • Web Hosting
  • cPanel
  • How to Redirect a Page or Website Using .htaccess
View Categories

How to Redirect a Page or Website Using .htaccess

6 min read

How to redirect a page or website using .htaccess

If a page on your website has moved or no longer exists, visitors who follow an old link will hit a “404 Not Found” error. A redirect solves this by automatically sending anyone who requests the old address to the new one instead.

Redirects are handled by a file called .htaccess, which sits on your hosting account and tells the web server how to respond to certain requests. This guide covers the most common redirect types, where to put the code, and how to check it worked.

Does your hosting support .htaccess? #

The .htaccess file is a feature of the Apache and LiteSpeed web servers, which is what our shared hosting and most of our server plans run. If that is you, everything in this guide applies.

Two setups work differently. Sites running on Nginx ignore .htaccess entirely, and redirects have to be added to the server configuration instead. Sites on Windows hosting use a file called web.config rather than .htaccess. If your site is on either of those, open a support ticket with the old and new addresses and we will set the redirect up for you.

The instructions below use cPanel because that is what most customers have, but .htaccess is not a cPanel feature. If you use a different control panel, or reach your files by FTP or SSH, the file lives in the same place and the code is identical. Only the steps for opening it differ.

Before you start #

Find your .htaccess file. Log in to cPanel, open File Manager, and go to the folder that holds your website. For most accounts this is public_html. If you run more than one website on the account, each add-on domain has its own folder with its own .htaccess file, so make sure you are in the right one.

Turn on hidden files. Any filename beginning with a dot is hidden by default. In File Manager, click Settings in the top right, tick Show Hidden Files (dotfiles), then click Save.

Create the file if it isn’t there. Not every site has one yet. If you don’t see .htaccess in the folder, click + File, name it .htaccess exactly (including the leading dot, and with no .txt on the end), and save.

Make a backup first. Right click the file, choose Copy, and save a copy as something like htaccess-backup.txt before you change anything. A small typo in this file can take your whole site offline, so having the original to restore is worth the thirty seconds.

To edit the file, right click it and choose Edit.

301 or 302: which one to use #

You will see both numbers in redirect code. They mean different things:

  • 301 is a permanent redirect. Use this when the old page is never coming back. Search engines will transfer the old page’s ranking value to the new page and update their index over time. This is what you want in almost every case.
  • 302 is a temporary redirect. Use this only when the old page really is coming back, for example while you rebuild a page or run a short campaign. Search engines keep the old page in their index and pass no ranking value to the new one.

If you are not sure, use 301.

Redirect one page to another page on the same site #

Add this line to your .htaccess file:

apache
Redirect 301 /oldpage.html /newpage.html

Now anyone who visits example.com/oldpage.html lands on example.com/newpage.html instead.

Two details matter here. The first path must start with a forward slash and must not include your domain name. The second path is where visitors end up, and because it is on the same site you can write it as a path in the same way.

If the old page sits in a subfolder, include the folder in the path:

apache
Redirect 301 /blog/old-article.html /blog/new-article.html

Redirect one page to a different website #

When the destination is on another domain, write it out as a full URL including https://:

apache
Redirect 301 /mypage.html https://example.com/

If you leave off the https:// part, the server treats it as a path on your own site and the redirect will not go where you expect.

Redirect a whole directory #

To move every page inside a folder, point the folder itself at its new location:

apache
Redirect 301 /old-folder /new-folder

This carries the rest of the address across automatically. A request for example.com/old-folder/page1.html becomes example.com/new-folder/page1.html without you needing a separate line for each page.

Redirect an entire website to a new domain #

If you have rebranded or moved to a new domain, place this in the .htaccess file of the old site:

apache
Redirect 301 / https://newdomain.com/

Every page on the old domain will now redirect to the matching page on the new one.

One warning: only do this when the two domains point at separate folders on the server. If both domains are set up to load the same folder, this line sends the site into an endless loop and nothing will load. In that situation you need a different approach, so contact our support team and we will set it up for you.

Do I need the RewriteEngine line? #

No. You may have seen RewriteEngine on written above redirect code elsewhere. That line belongs to a different Apache module (mod_rewrite) and does nothing for the Redirect lines shown in this guide. Including it is harmless, but leaving it out keeps the file cleaner and easier to read later.

Mod_rewrite is a more advanced tool used for pattern-based rules, such as redirecting every URL that contains a particular word. If your redirect is a straight swap of one address for another, the Redirect lines above are the simpler and better option.

Adding more than one redirect #

You can stack as many redirects as you need, one per line:

apache
Redirect 301 /about-us.html /about.html
Redirect 301 /services.html /what-we-do.html
Redirect 301 /old-blog https://blog.example.com/

The server reads the file from top to bottom and uses the first rule that matches. Avoid redirecting a page to another page that is itself redirected somewhere else, because chaining redirects slows the site down and can confuse search engines. Always point the old address straight at its final destination.

Lines beginning with # are comments. The server ignores them, so they are useful for leaving notes to yourself:

apache
# Old service pages retired March 2026
Redirect 301 /services.html /what-we-do.html

Test that it worked #

Save the file, then open the old address in your browser. You should land on the new page, and the address bar should show the new URL rather than the old one.

If nothing seems to change, try again in a private or incognito window. Browsers store 301 redirects aggressively, and once your browser has learned an old rule it will keep using it even after you change the file. A private window ignores that stored copy and shows you the current behaviour.

If something goes wrong #

The site shows a 500 Internal Server Error. This almost always means a typo in the .htaccess file. Check for a missing slash, a missing https://, or a line that has been split in half. If you cannot spot it, restore the backup you made earlier and the site will come straight back.

The redirect doesn’t happen at all. Confirm you edited the .htaccess file in the correct folder. If the site is on an add-on domain, the file in public_html is the wrong one.

The page keeps reloading or times out. You have likely created a loop by redirecting a page to itself, or by redirecting a domain to another domain that loads the same folder. Remove the rule and get in touch with us.

Your CMS overwrote your changes. WordPress and similar platforms manage part of the .htaccess file themselves. Add your redirects above the block marked # BEGIN WordPress, not inside it, or the next permalink change will wipe them out. For WordPress sites, a redirect plugin is often easier to manage than editing the file by hand.

If you get stuck at any point, open a support ticket and include the old and new addresses you are trying to link up. We can apply the redirect for you.

Did you like this article ?

Share This Article :

  • Facebook
  • X
  • LinkedIn
Updated on September 4, 2026
How to Retrieve a CSR from cPanelHow to Remove a CSR code in cPanel
Table of Contents
  • Does your hosting support .htaccess?
  • Before you start
  • 301 or 302: which one to use
  • Redirect one page to another page on the same site
  • Redirect one page to a different website
  • Redirect a whole directory
  • Redirect an entire website to a new domain
  • Do I need the RewriteEngine line?
  • Adding more than one redirect
  • Test that it worked
  • If something goes wrong
dc-logo

Subscribe to our Newsletter

Services

Web Hosting

Domain Registration

Email Solutions

Domain Transfer

Website Services

Company

About Us

Blog

Contact Us

Legal

Accessibility Statement

customer service



Help Centre



Existing Client Login



Sales Enquiries



System Status

customer service



Help Centre



Existing Client Login



Sales Enquiries



System Status

Services

Web Hosting

Domain Registration

Email Solutions

Domain Transfer

Website Services

Company

About Us

Blog

Contact Us

Legal

Accessibility Statement

© Copyright Domain Central ANZ 2025

Privacy Policy • Terms of Service 

  • Follow
  • Follow
  • Follow
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behaviour or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}