• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

What is the best way to disable a website for maintenance?

Explorer ,
Aug 07, 2007 Aug 07, 2007

Copy link to clipboard

Copied

I'm thinking of building a button inot my admin section of my site that when pushed would set an application variable or something to send people to a different splash screen when they log in that will tell them the site is down for maintenance. Any ideas on what the best way to do this would be? Does anyone know of any example apps out there I could look at?

Thanks!
TOPICS
Advanced techniques

Views

461

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 07, 2007 Aug 07, 2007

Copy link to clipboard

Copied

I use Application.cfm to check my database settings.

So you have a cfquery tag retrieve the settings, check if maintenance is 1, If so, you can do one of two things
1 is redirect using cflocation to maintenance.cfm and exit processing the file.
2 is to include maintenance.cfm and have maintenance.cfm exit processing the file

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 07, 2007 Aug 07, 2007

Copy link to clipboard

Copied

The cool thing about this code here is the use of a debug mode cookie. If the cookie is set with the secret key, then that person can still view the website. You have a form in the back end that sets up the cookie with the same key. So when you are ready for maintenance, you can shut down the website, enable the machine you are using to have debug mode enabled and debug any changes without them being visible to the public.

This even works when you are not in maintenance.

Say you are working on a new section of code, you can put it into a separate file (in case of syntax errors) and then only include the file if the debug mode is enabled.

Great if you are changing an entire section such as your header, or main template even, but you still want everyone else to see the old one until you are finished.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 07, 2007 Aug 07, 2007

Copy link to clipboard

Copied

LATEST
Thanks guys. I will check these ideas out!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation