Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Upgrading SilverStripe

Ask questions about upgrading SilverStripe to the latest version.

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

maintanence and upgrading live sites


Reply

5 Posts   1734 Views

Avatar
ChrisBryer

29 January 2009 at 1:30pm Community Member, 95 Posts

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

Avatar
Willr

29 January 2009 at 3:36pm (Last edited: 29 January 2009 3:36pm), Forum Moderator, 5511 Posts

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]

Avatar
ChrisBryer

30 January 2009 at 5:49am Community Member, 95 Posts

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

Avatar
Willr

30 January 2009 at 9:36am Forum Moderator, 5511 Posts

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.

Avatar
ChrisBryer

30 January 2009 at 9:54am Community Member, 95 Posts

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