Redirecting Visitors to an Under Construction Page

When updating your website, you may want to block all visitors except yourself. You can do this by adding a temporary 302 redirect in your .htaccess file that sends everyone else to a construction page. This lets you work on the site privately while showing visitors a “coming soon” or “under construction” message.

Important: First create a file named construction.html in your public_html directory. (For help creating this page, see InMotion Hosting’s guide on building an Under Construction or Coming Soon page.)

Steps to Allow Access from Only One IP Address

  1. Find your current IP address. Visit support.inmotionhosting.com/ipcheck.php and note the IP shown.
  2. Log in to cPanel.
  3. Open File Manager
    • Select the public_html web root.
    • Check the box for Show Hidden Files.
    • Click Go.
  4. Edit the .htaccess file using the Code Editor.
  5. Add the following code at the very top of the .htaccess file (replace 123.45.67.89 with your actual IP address):
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^123.45.67.89$
RewriteCond %{REQUEST_URI} !construction.html
RewriteRule ^(.*)$ /construction.html [R=302,L]

Save the file to implement the Under Construction page.

Notes:

  • If you are using a subdomain, place RewriteEngine Off in that subdomain’s own .htaccess file.
  • After saving, anyone whose IP is not the one you listed will be redirected to /construction.html.
  • Dynamic IP addresses can change. If you lose access later, check your current IP again and update the rule in .htaccess.
Summarize and Research with AI
Share on Social Media
Carrie Smaha
Carrie Smaha Senior Manager Marketing Operations

Carrie Smaha is a digital strategy, web development, and SEO leader with 20 years of experience. She built her foundation in fast-paced agency environments before moving in-house to InMotion Hosting, where she leads go-to-market programs, agency initiatives, and technical product marketing that connects product capability to real customer decisions.

More Articles by Carrie