Lindy dB.21 Oct 2026Updated 21 Oct 2026Web Hosting4 min read

How to Temporarily Take Your Website Offline in cPanel, DirectAdmin or PanelAlpha

On this page

Sometimes you need your website out of the way for a little while. Maybe you're redesigning it, moving content around, fixing something that broke, or you simply don't want visitors landing on a half-finished page.

The good news is that you don't need to delete anything or cancel your hosting. You can put your site into maintenance mode, show visitors a short "down for maintenance" message, and switch it back on when you're ready.

This guide shows you how to do it in cPanel, DirectAdmin and PanelAlpha. Pick the section for the control panel you use. Each one takes a few minutes.

Before You Start

In cPanel and DirectAdmin, maintenance mode means adding three lines to your site's .htaccess file. If you've never worked with this file before, our guide to the basics of the .htaccess file explains what it is and where it lives.

The maintenance rule blocks every page on the site, including the WordPress admin area if you run WordPress. Finish any changes you need to make inside WordPress before you switch it on.

The Maintenance Code

This is the code you'll add in cPanel and DirectAdmin:

ErrorDocument 503 "<h1>Site temporarily down for maintenance</h1>"
RewriteEngine On
RewriteRule .* - [R=503,L]

Put these three lines at the very top of .htaccess, above everything else in the file. Apache reads the file from top to bottom. On a WordPress site, the existing WordPress rewrite block would otherwise serve your pages before the maintenance rule is ever reached, and your site would stay online.

You can change the text between the <h1> tags to any message you like, as long as it stays on one line and inside the double quotes.

Why a 503 Status Is the Right Choice

The code tells the server to answer every request with a 503 "Service Unavailable" status. That status matters for search engines. It tells Google and other search engines that the downtime is temporary, so they come back later instead of treating your pages as gone or indexing your maintenance message in place of your real content.

Keep the downtime as short as you can. If a site returns a 503 for many days in a row, search engines may start to treat the pages as no longer available.

How to Take Your Site Offline in cPanel

  1. Log in to your cPanel.
  2. Open File Manager.
  3. Go to the public_html folder.
  4. If you can't see .htaccess, click Settings in the top-right corner, tick Show Hidden Files (dotfiles) and save.
  5. Right-click .htaccess and select Edit.
  6. Paste the maintenance code at the very top of the file.
  7. Click Save Changes.
  8. Visit your website to check that the maintenance message appears.

If there's no .htaccess file at all, even with hidden files showing, create a new file named .htaccess in public_html and paste the code into it.

How to Take Your Site Offline in DirectAdmin

  1. Log in to your DirectAdmin dashboard.
  2. Open File Manager.
  3. Go to domains/yourdomain.com/public_html/, replacing yourdomain.com with your own domain.
  4. Find the .htaccess file. If you can't see it, turn on the option to show hidden files.
  5. Select .htaccess and click Edit.
  6. Paste the maintenance code at the very top of the file.
  7. Save the file.
  8. Open your website in a private or incognito browser window to check that the maintenance message appears.

A private window matters here because your normal browser may still show you a cached copy of the live site.

How to Take Your Site Offline in PanelAlpha

PanelAlpha is the dashboard behind HostAfrica's WordPress hosting, and it has a built-in maintenance mode, so there's no file to edit.

  1. Log in to your PanelAlpha dashboard.
  2. Find your site and click the three dots under Actions on the right.
  3. Select Manage from the drop-down menu.
  4. Click the Advanced tab and go to Developer Settings.
  5. Click the Maintenance Mode toggle to turn it on for your site.

Bringing Your Site Back

When you're ready to go live again, undo the change.

In cPanel or DirectAdmin:

  1. Open .htaccess in the File Manager, the same way you did before.
  2. Delete the three maintenance lines at the top of the file. If you'd rather keep them for next time, comment them out instead by adding # at the start of each line.
  3. Save the file.
  4. Check your website in a private or incognito window to confirm it loads normally.

If you kept a .htaccess.bak copy, you can instead delete the edited file and rename the copy back to .htaccess.

In PanelAlpha:

  1. Go back to Advanced and then Developer Settings for your site.
  2. Click the Maintenance Mode toggle to turn it off.

That's it. Your site is back online, and search engines will pick up where they left off.

Ready to put your site online?

Fast, reliable web hosting with free migrations and 24/7 support.

Avatar for Lindy dB.

Lindy dB.

The Author

Lindy brings over 7 years of experience in SEO, web development, UI/UX design, and marketing to the table, with a special focus on the hosting industry. When not geeking out over the latest digital trends, you can find Lindy buried in a good book or exploring worlds in video games.