7 Replies Latest reply on Aug 6, 2008 11:31 AM by Newsgroup_User

    Temporarily deactivating a website

    AngryCloud Level 1
      At some point or another, most people have tried accessing one of their favorites websites only to get a message saying something like:
      "Site is currently under maintenance and will be up again shortly. Please try again in a few minutes."
      During this time no pages on the site seem to accessible.

      I would like to do something like this with my own website. When I am performing some sort of modification or maintenance routine, I want all files to be inaccessible (especially those that access the database) and users should be presented with a message telling them the site will be back up shortly.

      How can I make this work?
        • 1. Re: Temporarily deactivating a website
          Level 7
          The easiest way I can think of (assuming you are on a *nix server) would be
          to put up a .htaccess file that redirects all page calls to this "out of
          service" page.

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          ==================


          "AngryCloud" <webforumsuser@macromedia.com> wrote in message
          news:g72fqo$fm2$1@forums.macromedia.com...
          > At some point or another, most people have tried accessing one of their
          > favorites websites only to get a message saying something like:
          > "Site is currently under maintenance and will be up again shortly. Please
          > try
          > again in a few minutes."
          > During this time no pages on the site seem to accessible.
          >
          > I would like to do something like this with my own website. When I am
          > performing some sort of modification or maintenance routine, I want all
          > files
          > to be inaccessible (especially those that access the database) and users
          > should
          > be presented with a message telling them the site will be back up shortly.
          >
          > How can I make this work?
          >

          • 2. Re: Temporarily deactivating a website
            AngryCloud Level 1
            So would simply using this line in the .htaccess file do the trick?:

            Redirect 301 / http://www.mydomain.com/maintenance.php
            • 3. Re: Temporarily deactivating a website
              Level 7
              .oO(Murray *ACE*)

              >The easiest way I can think of (assuming you are on a *nix server) would be
              >to put up a .htaccess file that redirects all page calls to this "out of
              >service" page.

              Indeed. A Redirect directive with status code 307 should work.

              It might require a RedirectMatch directive in order to only redirect the
              pages, but not CSS and image URLs.

              Micha
              • 4. Re: Temporarily deactivating a website
                AngryCloud Level 1
                quote:

                Originally posted by: Newsgroup User
                .oO(Murray *ACE*)

                Indeed. A Redirect directive with status code 307 should work.



                I seem to be getting a lot of different answers for the code. So far I have been told 301, 302, 503 and now 307. I will take your word for it though. You have given me good advice plenty of times before.
                • 5. Re: Temporarily deactivating a website
                  Level 7
                  .oO(AngryCloud)

                  >
                  quote:

                  Originally posted by: Newsgroup User
                  > .oO(Murray *ACE*)
                  >
                  > Indeed. A Redirect directive with status code 307 should work.
                  >

                  >
                  > I seem to be getting a lot of different answers for the code. So far I have
                  >been told 301, 302, 503 and now 307. I will take your word for it though. You
                  >have given me good advice plenty of times before.

                  Hmm. 301 is definitely wrong here (you're not redirecting permanently)
                  and 302 is just an unspecific redirect. 503 might be a good option in
                  conjunction with an ErrorDocument directive, but I haven't used it yet,
                  so I can't say if it would be appropriate here. With such rather exotic
                  status codes you should also test how browsers will behave, especially
                  IE. Might be worth a test anyway. But if it fails or if you're unsure,
                  use a 307. I think it's the safest kind of redirect in this case.

                  Micha
                  • 6. Re: Temporarily deactivating a website
                    DoublehardUK Level 1
                    Do not use a 301 - The 301 is a permanent redirect message and you will be informing a search engine that all your content has been permanently removed.

                    I would look at 503, there is some goo info at the following location - http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
                    • 7. Re: Temporarily deactivating a website
                      Level 7
                      .oO(DoublehardUK)

                      > I would look at 503, there is some goo info at the following location -
                      > http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html

                      Thanks for that.

                      After some further reading I think I will implement the 503 in my own
                      framework. I have a kind of maintenance module there, which can be used
                      to "shutdown" the entire site for a while - every request will then just
                      return a short note about the remaining maintenance time out and a login
                      form, so that site admins can still gain access. I think the 503 could
                      make sense there.

                      Micha