A site update should not leave visitors staring at a broken layout, database error, or half-finished checkout page. Learning how to create a maintenance mode page using .htaccess in cPanel gives you a simple way to show a professional notice while you work behind the scenes.

This method is useful for WordPress sites, HTML sites, and many other websites on shared hosting. It does not require a plugin, and it can be turned on or off quickly from cPanel. The key is setting it up carefully so visitors see a maintenance page while you can still access the site to finish your updates.

Before You Enable Maintenance Mode

A maintenance page should be used for short, planned work such as updating a theme, moving files, changing site settings, or repairing a database issue. If your site will be unavailable for more than a few minutes, add a clear message that tells visitors when to check back.

Before editing anything, save a copy of your current .htaccess file. This small step makes recovery easy if a typo causes an error. Also, have the public IP address of the device you will use for site updates. You will add that address to the rule so you are not locked out with everyone else.

Your public IP address may change, especially on home or mobile connections. If the rule stops letting you in, use cPanel File Manager to remove the maintenance code temporarily, then check and update your IP address.

Create Your Maintenance Page in cPanel

Start by creating the page visitors will see. In cPanel, open File Manager and go to your website’s document root. For the main domain, this is usually the public_html folder. Add-on domains and subdomains may use a different folder, so confirm you are working in the same location as the site’s main files.

Create a new file named maintenance.html. Keep the filename simple and use lowercase letters to avoid case-sensitivity issues on Linux hosting.

Add a short, helpful message. Here is a basic example:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>We'll Be Back Soon</title>
  <style>
    body { font-family: Arial, sans-serif; max-width: 650px; margin: 12% auto; padding: 20px; text-align: center; color: #222; }
    h1 { font-size: 32px; }
  </style>
</head>
<body>
  <h1>We're performing scheduled maintenance.</h1>
  <p>Our website will be back shortly. Thank you for your patience.</p>
</body>
</html>

You can include your logo, business name, and a support email address if appropriate. Avoid adding complex scripts, large images, or elements that depend on your application database. The maintenance page should load even when the rest of the site is being repaired.

How to Create a Maintenance Mode Page Using .htaccess in cPanel

In File Manager, make sure hidden files are visible. Select Settings in the upper-right area of File Manager and enable the option to show hidden files, sometimes called dotfiles. Then open the .htaccess file in your site’s document root.

If you do not see an .htaccess file, you can create one, but be cautious. Many WordPress sites already have one with important permalink rules. Never replace existing content just to add maintenance mode.

Paste the following code near the top of the file, before WordPress or other application rewrite rules:

RewriteEngine On
# Replace this with your own public IP address
RewriteCond %{REMOTE_ADDR} !^203.0.113.25$
# Do not block the maintenance page itself
RewriteCond %{REQUEST_URI} !^/maintenance.html$
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html

Replace 203.0.113.25 with your own public IP address. Do not copy that sample address as-is. The IP exception is what allows you to continue visiting the live site, logging in, and completing your work while other visitors receive the maintenance message.

Save the file, then open your site in a private or incognito browser window. A private window helps avoid confusion from browser cache or an active administrator session.

Why the 503 Status Code Matters

The R=503 portion tells web browsers and search engines that the outage is temporary. That is better than sending everyone to a normal page with a 200 OK status, which can make it appear that your maintenance message is the real page content.

A 503 response is the standard signal for planned downtime. Search engines generally understand that they should come back later rather than remove pages from their results immediately. It is not a substitute for good uptime, but it is the correct choice when short maintenance is necessary.

The ErrorDocument 503 line tells the server which file to display with that status. The rule excluding maintenance.html prevents a loop where the server tries to send the maintenance page to itself repeatedly.

Add More Than One IP Address When Needed

If a developer, designer, or business partner also needs access during maintenance, add one condition for each approved IP address. For example:

RewriteCond %{REMOTE_ADDR} !^203.0.113.25$
RewriteCond %{REMOTE_ADDR} !^198.51.100.14$
RewriteCond %{REQUEST_URI} !^/maintenance.html$
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html

Keep this list limited to people who genuinely need access. Every exception gives another visitor a path around the maintenance screen.

If you work from a changing IP address, a plugin-based maintenance mode may be more convenient for a WordPress-only site because some plugins let you allow access by logged-in user role. The .htaccess approach remains a strong option when you need a lightweight, site-wide block that does not depend on WordPress loading correctly.

Common Problems and Quick Fixes

A 500 Internal Server Error after saving .htaccess usually means there is a syntax problem. Restore your backup, then add the code again carefully. Check that every RewriteCond line begins correctly and that your IP address contains only numbers and periods.

If visitors still see the normal site, check the placement of the maintenance rules. On WordPress installations, the rules must appear above the # BEGIN WordPress section. Also clear any cache plugin, CDN cache, or server-side cache that may continue serving a stored version of your pages.

If you see the maintenance page but cannot access the site yourself, the most likely cause is an incorrect IP address. Open cPanel File Manager, edit .htaccess, and either correct the address or remove the maintenance block. You can then check your current public IP and try again.

If your site is installed in a subfolder, adjust the maintenance page path. For example, a site in /shop/ may need /shop/maintenance.html rather than /maintenance.html. The page location and the .htaccess file must match the website folder being protected.

Turn Maintenance Mode Off When You Finish

As soon as you have tested the update, remove the maintenance block from .htaccess or place a # at the beginning of each line to comment it out. Save the file, clear relevant caches, and test the site from a private browser window.

Do not leave a maintenance page active longer than necessary. Visitors may assume a long outage means the business is no longer available, and potential customers may move on before seeing your real site.

A clear maintenance page, the proper 503 response, and a tested access exception give you a practical safety net for routine website work. Keep a copy of this setup with your site notes so the next update is controlled, professional, and easy to reverse.