Jump to:

1155 Posts in 2568 Topics by 408 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » maintanence and upgrading live sites

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1706 Views
  • ChrisBryer
    Avatar
    Community Member
    95 Posts

    maintanence and upgrading live sites Link to this post

    hi everyone,
    I'm building a few sites with SS 2.2.3 right now and know in the future my clients will want to upgrade to version 2.3 when there is a true release version out. because SS uses an .htaccess file, what is the best way to re-route traffic to a ' temporary maintenance' page but still do maintenance (i.e. delete & upload new saphire code, make sure live SS doesnt have any problems, etc...), so the user doesnt hit a 500 error, the site still appears pleasant and error free, and i can do what i need to do to upgrade? i tried a cp redirect, but it looks like .htaccess overrides that...

    thanks alot.
    -Chris

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: maintanence and upgrading live sites Link to this post

    Lots of ways to do this, some people do it with a .htaccess file something like changing the RewriteRule in the .htaccess. I have used this...

    RewriteCond %{REQUEST_URI} !/maintenance.html$
    RewriteCond %{REMOTE_HOST} !^212\.123\.239\.177 <!--- YOUR IP.

    RewriteRule $ /maintenance.html [R=302,L]

  • ChrisBryer
    Avatar
    Community Member
    95 Posts

    Re: maintanence and upgrading live sites Link to this post

    That's great. i tested and it works well. is there any way to add a condition so that it still allows access to the CMS, lets me run db/build, and lets me check things on a draft site before i remove the maintenance rules?

    thanks again,
    i really appreciate your advice,
    -Chris

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: maintanence and upgrading live sites Link to this post

    Thats what the second line is for - RewriteCond %{REMOTE_HOST} !^212\.123\.239\.177 <!--- YOUR IP. That Line means that this rule with apply for hosts that don't have this IP address.

  • ChrisBryer
    Avatar
    Community Member
    95 Posts

    Re: maintanence and upgrading live sites Link to this post

    that's perfect. thanks alot. i tested on localhost, and for some reason it didnt work, but as long as it works on the live site (which i'll be testing), that's perfect!

    thanks again,
    great job with the CMS. I really enjoy working with it.
    -Chris

    1706 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.