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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

maintanence and upgrading live sites


Go to End


5 Posts   3070 Views

Avatar
ChrisBryer

Community Member, 95 Posts

29 January 2009 at 1:30pm

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

Forum Moderator, 5523 Posts

29 January 2009 at 3:36pm

Edited: 29/01/2009 3:36pm

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

Community Member, 95 Posts

30 January 2009 at 5:49am

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

Forum Moderator, 5523 Posts

30 January 2009 at 9:36am

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

Community Member, 95 Posts

30 January 2009 at 9:54am

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