General discussion
Auto redirect everything to just one page

I was wondering if anyone knew if there was a way to have everything redirect to one page I made for a "maintenance" screen. I am assuming it would to do something with the routes.php script but I can't figure it out. Cheers

I was wondering if anyone knew if there was a way to have everything redirect to one page I made for a "maintenance" screen. I am assuming it would to do something with the routes.php script but I can't figure it out. Cheers

Hi,

Yes, you can create a new route in routes.php file. Make sure its the first route.

dispatch_get('/**', function (){

    echo "Sorry, under maintenance!";
    exit; // Important so that other routes are not loaded or you can put the whole route in an if with maintenance flag
});
Hi, Yes, you can create a new route in routes.php file. Make sure its the first route. ``` dispatch_get('/**', function (){ echo "Sorry, under maintenance!"; exit; // Important so that other routes are not loaded or you can put the whole route in an if with maintenance flag }); ```
Necessity is the mother of all inventions!
102
2
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft