Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1039211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:04:17+00:00 2026-05-16T15:04:17+00:00

Don’t need to do this right now but thinking about the future… What would

  • 0

Don’t need to do this right now but thinking about the future…

What would be your method to take a website “offline” for a little bit through a custom coded cms? Meaning give the capability for an admin to login into an admin panel, type a message into a box, and submit the form. That message would then display rather than any other page to any user, unless the user is an admin.

I have done this before and used a if xml file exists then load the content from the xml file and puts a construction background behind the message with a login box that only allows admins to log in. When the admin would type the message into the box it stored the text into the xml. When they brought the site “back to life” it would simply delete the xml file.

The only problem was that once the site grew, it took more hits and checking for a file exists every page load was becoming slow. Anyone have a better solution for me?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:04:18+00:00Added an answer on May 16, 2026 at 3:04 pm

    Assuming this is on Apache.

    If at all possible, I’d recommend doing this using a .htaccess file that re-routes all requests to a “site is down” message.

    Something like:

    RewriteRule (.*) /downmessage.php [L]
    

    (note that any image resources will be redirected, too)

    Compared to a PHP-side flag check and offline message, this is faster, plus it has the huge advantage that resources like uploaded images and style sheets are no longer reachable either – which they otherwise might be, through cached files, URLs, Google Images hits…

    In a PHP-based “offline” mechanism where those resources are not blocked, the fact that some resources are still reachable if somebody knows the URL is very difficult to explain to users (“but we took the site down, didn’t we?”) and if the site gets taken down because of legal problems regarding a published image (can happen to everyone!), the image could still be reachable without the site owner knowing.

    The downside to this is that it requires the mod_rewrite module on the server, and PHP needs to have write access to the .htaccess file: Both not always the case.

    However, while this method has its advantages, the basic premise of your question is worth looking at before implementing any changes. You say that the check for the takedown XML file is taking too much time. I don’t think that is the case. file_exists() checks are cached internally, and should not cause any noticeable slowdown even for very many requests. The average Drupal or WordPress page loads dozens of include files on every request. A single file_exists pales in comparison.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.