Announcement

Collapse
No announcement yet.

redirect for whole site?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    redirect for whole site?

    I'm trying to move host this weekend and in order to minimise confusion I'm going to put old and new sites offline for a day or so while DNS servers get up to speed. It would appear that the simplest thing to do is have a comprehensive redirect on the site such that any page request, including via cgi-bin, is redirected to my serverdown.html holding page. However, I can't seem to find a way of expressing this in .htaccess - most efforts end up with a 404 error.
    I though the following would work
    Redirect /acatalog http://www.mydomain/serverdown.html
    Redirect /cgi-bin http://www.mydomain/serverdown.html
    Redirect /index.html http://www.mydomain/serverdown.html
    But I'm just getting 404's.
    An 'obvious' entry such as
    Redirect / http://www.mydomain/serverdown.html
    also fails, probably because the reference is circular.

    Any ideas?

    Thanks,
    simon
    Cult Pens

    #2
    I get a 404 if I type in http://www.cultpens.com/serverdown.html

    is this the real name of the page you wantto redirect to?

    Comment


      #3
      Hi Jo,

      My long-postponed move to your servers is slowly under way...

      No, that isn't the page. I'm playing with .htaccess on my not-yet-live Pinbrook server using the hard-coded IP address - not wishing to keep breaking my currently live site.

      Some digging around has yielded the following, which seems to work:

      RewriteEngine on
      RewriteRule !serverdown.html$ http://www.mydomain/serverdown.html [R,L]

      Now I just need to force a 503 error to keep any wandering SE spiders happy.

      simon
      Cult Pens

      Comment


        #4
        don't forget you can upload the site to your DS by using the IP in actinic network settings

        then if you redirect from your old site to the ip of the new site you shouldn't lose any visitors whilst DNS is propagating

        Comment


          #5
          Originally posted by pinbrook
          don't forget you can upload the site to your DS by using the IP in actinic network settings
          Yep, done that.

          Originally posted by pinbrook
          then if you redirect from your old site to the ip of the new site you shouldn't lose any visitors whilst DNS is propagating
          Looked at that and decided the scope for confusion was just too great. I'm not particularly happy connecting to the new site until our ISP reflects the change. Could do with a break from the relentless orders anyway

          So once WE can see the new site via DNS rather than old, I'll refresh the site and the redirection will come off.

          simon
          Cult Pens

          Comment


            #6
            I'm not particularly happy connecting to the new site until our ISP reflects the change.
            you could have problems with PSP as it will probably be using domain name to identify the site too

            Comment


              #7
              Nah, successfully used the stopgap domain you provided to test Protx before putting it live at CWCS last week.

              Question: Is it possible to set a 503 HTTP error from within an html page?
              I've seen a php solution to generate a 503 page, but would prefer to do it from a simple html page (and have no php knowledge to make the following example generate a 'nicer' page).

              PHP Code:
              <?php
              header
              ("HTTP/1.1 503 Service Unavailable");
              echo 
              'Sorry, Cult Pens is temporarily down for site maintenance.  Please call back on Monday';
              ?>
              simon
              Cult Pens

              Comment

              Working...
              X