Under Construction & block other pages in CI |
04-10-2016, 09:02 AM
(This post was last modified: 04-10-2016, 09:08 AM by PaulD. Edit Reason: Added PS )
For user login parts of the site:
Guessing that you have a live site, with users that can log in, put a little test in your login script that checks a setting in your db to see if the site is live or not. If it is not, do not log them in but redirect to a holding page view. I also test to see if the user is a site admin user too, if so it lets me log in and go to the site like normal. Any other user gets shut out. I also make sure the 'authorise user' script does the check too, so any already logged in users get logged out on their next page request and redirected. For the site as a whole: I change the index.php file name to index-off.php, and then change my construction page from index-off.html to index.html. Now the site shows the construction page. I also have a .htaccess file that I use to redirect all urls to index.html Then I upload all the application files. Then I change the filenames back again, and tada, the site is live again. Manual, mechanical, but fool proof! Best wishes Paul. PS Diedriks answer above with the pre-controller hook and cartalots solution are probably better solutions, I just have never done it that way but might give it a go. |
Messages In This Thread |
Under Construction & block other pages in CI - by ardavan - 01-19-2016, 08:31 PM
RE: Under Construction & block other pages in CI - by InsiteFX - 01-19-2016, 09:16 PM
RE: Under Construction & block other pages in CI - by skunkbad - 01-19-2016, 10:51 PM
RE: Under Construction & block other pages in CI - by ardavan - 04-09-2016, 08:07 PM
RE: Under Construction & block other pages in CI - by Diederik - 01-19-2016, 11:36 PM
RE: Under Construction & block other pages in CI - by cartalot - 01-20-2016, 02:13 PM
RE: Under Construction & block other pages in CI - by PaulD - 04-10-2016, 09:02 AM
|