{"id":3022,"date":"2018-01-09T19:28:43","date_gmt":"2018-01-09T19:28:43","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=3022"},"modified":"2018-01-09T19:31:34","modified_gmt":"2018-01-09T19:31:34","slug":"codeigniter-maintenance-mode-setup","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/","title":{"rendered":"Setup Maintenance Mode in CodeIgniter"},"content":{"rendered":"<p>Maintenance mode helps to improve user experience by showing a notification when the site is going through maintenance. When the web application needs an update, it&#8217;s always a good idea to display a well-designed maintenance page instead of showing error on the website.<\/p>\n<p>CodeIgniter, itself doesn&#8217;t provide any functionality to setup maintenance mode. But there are many ways display a <b>maintenance page in CodeIgniter<\/b>. In this tutorial, we will show you how to put the site in maintenance mode in CodeIgniter.<\/p>\n<p>CodeIgniter&#8217;s Hooks feature provides an ability to modify the core functionality without modifying the core files. You can easily <b>setup maintenance page<\/b> or under construction page using hooks in CodeIgniter.<\/p>\n<p>Follow the below step-by-step guide to put your site in offline mode for maintenance in CodeIgniter.<\/p>\n<h2>Enable Hooks<\/h2>\n<p>First all you need to enable hooks. Edit the <code>application\/config\/config.php<\/code> file and set <code>$config['enable_hooks']<\/code> to <code>TRUE<\/code>.<\/p>\n<pre><span style=\"color: #0000BB\">$config<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'enable_hooks'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;<\/span><span style=\"color: #0000BB\">TRUE<\/span><span style=\"color: #007700\">;<\/span><\/pre>\n<h2>Define Maintenance Config<\/h2>\n<p>Edit the <code>application\/config\/config.php<\/code> file and define a new config variable for maintenance mode. Insert the following code at the bottom of the <code>config.php<\/code> file.<\/p>\n<pre><span style=\"color: #FF8000\">\/*<br \/>|--------------------------------------------------------------------------<br \/>|&nbsp;Maintenance&nbsp;Mode<br \/>|--------------------------------------------------------------------------<br \/>|<br \/>|&nbsp;For&nbsp;whatever&nbsp;reason&nbsp;sometimes&nbsp;a&nbsp;site&nbsp;needs&nbsp;to&nbsp;be&nbsp;taken&nbsp;offline.<br \/>|&nbsp;Set&nbsp;$config['maintenance_mode']&nbsp;to&nbsp;TRUE&nbsp;if&nbsp;the&nbsp;site&nbsp;has&nbsp;to&nbsp;be&nbsp;offline<br \/>|<br \/>|&nbsp;$config['maintenance_mode']&nbsp;=&nbsp;TRUE;&nbsp;\/\/&nbsp;site&nbsp;is&nbsp;offline<br \/>|&nbsp;$config['maintenance_mode']&nbsp;=&nbsp;FALSE;&nbsp;\/\/&nbsp;site&nbsp;is&nbsp;online<br \/>*\/<br \/><\/span><span style=\"color: #0000BB\">$config<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'maintenance_mode'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;<\/span><span style=\"color: #0000BB\">TRUE<\/span><span style=\"color: #007700\">;<\/span><\/pre>\n<h2>Defining Maintenance Hook<\/h2>\n<p>To let the system know about the maintenance hook, edit the <code>application\/config\/hooks.php<\/code> file and define hook.<\/p>\n<ul class=\"bullet_disk_list\">\n<li><code>pre_system<\/code> &#8211; Hook point. The hook will be called very early during system execution.<\/li>\n<li><code>class<\/code> &#8211; The name of the class wish to invoke.<\/li>\n<li><code>function<\/code> &#8211; The method name wish to call.<\/li>\n<li><code>filename<\/code> &#8211; The file name containing the class\/function.<\/li>\n<li><code>filepath<\/code> &#8211; The name of the directory containing hook script.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">$hook<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'pre_system'<\/span><span style=\"color: #007700\">][]&nbsp;=&nbsp;array(<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'class'&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'maintenance_hook'<\/span><span style=\"color: #007700\">,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'function'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'offline_check'<\/span><span style=\"color: #007700\">,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'filename'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'maintenance_hook.php'<\/span><span style=\"color: #007700\">,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'filepath'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'hooks'<br \/><\/span><span style=\"color: #007700\">);<\/span><\/pre>\n<h2>Maintenance Hook Class<\/h2>\n<p>Create a new hook file called <code>maintenance_hook.php<\/code> in the <code>application\/hooks\/<\/code> folder and write Maintenance hook script. The following code checks whether site maintenance mode is ON and load the maintenance page from application views folder.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if&nbsp;(&nbsp;!&nbsp;<\/span><span style=\"color: #0000BB\">defined<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'BASEPATH'<\/span><span style=\"color: #007700\">))&nbsp;exit(<\/span><span style=\"color: #DD0000\">'No&nbsp;direct&nbsp;script&nbsp;access&nbsp;allowed'<\/span><span style=\"color: #007700\">);<br \/><\/span><span style=\"color: #FF8000\">\/**<br \/>&nbsp;*&nbsp;Check&nbsp;whether&nbsp;the&nbsp;site&nbsp;is&nbsp;offline&nbsp;or&nbsp;not.<br \/>&nbsp;*<br \/>&nbsp;*\/<br \/><\/span><span style=\"color: #007700\">class&nbsp;<\/span><span style=\"color: #0000BB\">Maintenance_hook<br \/><\/span><span style=\"color: #007700\">{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">__construct<\/span><span style=\"color: #007700\">(){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">log_message<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'debug'<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #DD0000\">'Accessing&nbsp;maintenance&nbsp;hook!'<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">offline_check<\/span><span style=\"color: #007700\">(){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">file_exists<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">APPPATH<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'config\/config.php'<\/span><span style=\"color: #007700\">)){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include(<\/span><span style=\"color: #0000BB\">APPPATH<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'config\/config.php'<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(isset(<\/span><span style=\"color: #0000BB\">$config<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'maintenance_mode'<\/span><span style=\"color: #007700\">])&nbsp;&amp;&amp;&nbsp;<\/span><span style=\"color: #0000BB\">$config<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'maintenance_mode'<\/span><span style=\"color: #007700\">]&nbsp;===&nbsp;<\/span><span style=\"color: #0000BB\">TRUE<\/span><span style=\"color: #007700\">){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include(<\/span><span style=\"color: #0000BB\">APPPATH<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'views\/maintenance.php'<\/span><span style=\"color: #007700\">);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>}<\/span><\/pre>\n<h2>Maintenance Page<\/h2>\n<p>To display a well-designed maintenance page, create a <code>maintenance.php<\/code> file in the <code>application\/views\/<\/code> directory and insert the HTML.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php&nbsp;defined<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'BASEPATH'<\/span><span style=\"color: #007700\">)&nbsp;OR&nbsp;exit(<\/span><span style=\"color: #DD0000\">'No&nbsp;direct&nbsp;script&nbsp;access&nbsp;allowed'<\/span><span style=\"color: #007700\">);&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n&lt;!<span style=\"color:#bf4f24\">DOCTYPE<\/span> html>\r\n&lt;<span style=\"color:#bf4f24\">html<\/span> <span style=\"color:#bf4f24\">lang<\/span>=<span style=\"color:#0b6125\">\"en\"<\/span>>\r\n&lt;<span style=\"color:#bf4f24\">head<\/span>>\r\n    &lt;<span style=\"color:#bf4f24\">meta<\/span> <span style=\"color:#bf4f24\">charset<\/span>=<span style=\"color:#0b6125\">\"utf-8\"<\/span>>\r\n    &lt;<span style=\"color:#bf4f24\">title<\/span>>Site Under Maintenance&lt;\/<span style=\"color:#bf4f24\">title<\/span>>\r\n    &lt;<span style=\"color:#bf4f24\">link<\/span> <span style=\"color:#bf4f24\">href<\/span>=<span style=\"color:#0b6125\">\"http:\/\/localhost\/codeigniter\/assets\/css\/style.css\"<\/span> <span style=\"color:#bf4f24\">rel<\/span>=<span style=\"color:#0b6125\">\"stylesheet\"<\/span> <span style=\"color:#bf4f24\">type<\/span>=<span style=\"color:#0b6125\">\"text\/css\"<\/span> \/>\r\n&lt;\/<span style=\"color:#bf4f24\">head<\/span>>\r\n&lt;<span style=\"color:#bf4f24\">body<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"bg\"<\/span>>\r\n    &lt;<span style=\"color:#bf4f24\">h1<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"head text-center\"<\/span>>Site Under Maintenance&lt;\/<span style=\"color:#bf4f24\">h1<\/span>>\r\n    &lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"container\"<\/span>>\r\n        &lt;<span style=\"color:#bf4f24\">div<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"content1\"<\/span>> \r\n            &lt;<span style=\"color:#bf4f24\">img<\/span> <span style=\"color:#bf4f24\">src<\/span>=<span style=\"color:#0b6125\">\"http:\/\/localhost\/codeigniter\/assets\/images\/2.png\"<\/span> <span style=\"color:#bf4f24\">alt<\/span>=<span style=\"color:#0b6125\">\"under-construction\"<\/span>>\r\n            &lt;<span style=\"color:#bf4f24\">p<\/span> <span style=\"color:#bf4f24\">class<\/span>=<span style=\"color:#0b6125\">\"text-center\"<\/span>>Sorry for the inconvenience. To improve our services, we have momentarily shutdown our site.&lt;\/<span style=\"color:#bf4f24\">p<\/span>>\r\n        &lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n    &lt;\/<span style=\"color:#bf4f24\">div<\/span>>\r\n&lt;\/<span style=\"color:#bf4f24\">body<\/span>>\r\n&lt;\/<span style=\"color:#bf4f24\">html<\/span>>\r\n<\/pre>\n<h2>Enable\/Disable Maintenance Mode<\/h2>\n<p>Now you can enable the maintenance mode (offline) by settings <code>$config['maintenance_mode'] = TRUE;<\/code> To disable the maintenance mode (online), change it to <code>$config['maintenance_mode'] = FALSE;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maintenance mode helps to improve user experience by showing a notification when the site is going through maintenance. When the web application needs an update, it&#8217;s always a good idea to display a well-designed maintenance <\/p>\n","protected":false},"author":1,"featured_media":3023,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8],"tags":[55],"class_list":["post-3022","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codeigniter","tag-codeigniter","cat-8-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Setup Maintenance Mode in CodeIgniter - CodexWorld<\/title>\n<meta name=\"description\" content=\"CodeIgniter Maintenance Mode - Setup maintenance mode in CodeIgniter. Learn how to put site in maintenance mode using CodeIgniter hooks. Easy way to setup maintenance page or under construction page in CodeIgniter.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setup Maintenance Mode in CodeIgniter - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"CodeIgniter Maintenance Mode - Setup maintenance mode in CodeIgniter. Learn how to put site in maintenance mode using CodeIgniter hooks. Easy way to setup maintenance page or under construction page in CodeIgniter.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-09T19:28:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-09T19:31:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2018\/01\/codeigniter-maintenance-mode-page-setup-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Setup Maintenance Mode in CodeIgniter\",\"datePublished\":\"2018-01-09T19:28:43+00:00\",\"dateModified\":\"2018-01-09T19:31:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/\"},\"wordCount\":316,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/codeigniter-maintenance-mode-page-setup-codexworld.png\",\"keywords\":[\"CodeIgniter\"],\"articleSection\":[\"CodeIgniter\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/\",\"name\":\"Setup Maintenance Mode in CodeIgniter - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/codeigniter-maintenance-mode-page-setup-codexworld.png\",\"datePublished\":\"2018-01-09T19:28:43+00:00\",\"dateModified\":\"2018-01-09T19:31:34+00:00\",\"description\":\"CodeIgniter Maintenance Mode - Setup maintenance mode in CodeIgniter. Learn how to put site in maintenance mode using CodeIgniter hooks. Easy way to setup maintenance page or under construction page in CodeIgniter.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/codeigniter-maintenance-mode-page-setup-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/codeigniter-maintenance-mode-page-setup-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"codeigniter-maintenance-mode-page-setup-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/codeigniter-maintenance-mode-setup\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setup Maintenance Mode in CodeIgniter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setup Maintenance Mode in CodeIgniter - CodexWorld","description":"CodeIgniter Maintenance Mode - Setup maintenance mode in CodeIgniter. Learn how to put site in maintenance mode using CodeIgniter hooks. Easy way to setup maintenance page or under construction page in CodeIgniter.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/","og_locale":"en_US","og_type":"article","og_title":"Setup Maintenance Mode in CodeIgniter - CodexWorld","og_description":"CodeIgniter Maintenance Mode - Setup maintenance mode in CodeIgniter. Learn how to put site in maintenance mode using CodeIgniter hooks. Easy way to setup maintenance page or under construction page in CodeIgniter.","og_url":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2018-01-09T19:28:43+00:00","article_modified_time":"2018-01-09T19:31:34+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2018\/01\/codeigniter-maintenance-mode-page-setup-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Setup Maintenance Mode in CodeIgniter","datePublished":"2018-01-09T19:28:43+00:00","dateModified":"2018-01-09T19:31:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/"},"wordCount":316,"commentCount":7,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2018\/01\/codeigniter-maintenance-mode-page-setup-codexworld.png","keywords":["CodeIgniter"],"articleSection":["CodeIgniter"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/","url":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/","name":"Setup Maintenance Mode in CodeIgniter - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2018\/01\/codeigniter-maintenance-mode-page-setup-codexworld.png","datePublished":"2018-01-09T19:28:43+00:00","dateModified":"2018-01-09T19:31:34+00:00","description":"CodeIgniter Maintenance Mode - Setup maintenance mode in CodeIgniter. Learn how to put site in maintenance mode using CodeIgniter hooks. Easy way to setup maintenance page or under construction page in CodeIgniter.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2018\/01\/codeigniter-maintenance-mode-page-setup-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2018\/01\/codeigniter-maintenance-mode-page-setup-codexworld.png","width":1366,"height":768,"caption":"codeigniter-maintenance-mode-page-setup-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/codeigniter-maintenance-mode-setup\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Setup Maintenance Mode in CodeIgniter"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2018\/01\/codeigniter-maintenance-mode-page-setup-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-MK","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/3022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=3022"}],"version-history":[{"count":1,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/3022\/revisions"}],"predecessor-version":[{"id":3024,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/3022\/revisions\/3024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/3023"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=3022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=3022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=3022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}