-
-
Notifications
You must be signed in to change notification settings - Fork 5
Custom 404 Page
risingisland edited this page Aug 23, 2024
·
1 revision
The standard content file for the error 404 page is created and saved in “/data/other/404.xml”.
To customize it create a new page with slug 404. It will override the standard version.
The code is in index.php
# define page, spit out 404 if it doesn't exist
$file = GSDATAPAGESPATH . $id .'.xml';
$file_404 = GSDATAOTHERPATH . '404.xml';
$user_created_404 = GSDATAPAGESPATH . '404.xml';
if (! [file_exists](http://www.php.net/file_exists)($file)) {
if ([file_exists](http://www.php.net/file_exists)($user_created_404)) {
//user created their own 404 page, which overrides the default 404 message
$file = $user_created_404;
} elseif ([file_exists](http://www.php.net/file_exists)($file_404)) {
$file = $file_404;
}
exec_action('error-404');
}🏠 Home
⚙️ Installation
👷 Admin Reference
📝 Adding and Editing Content
- WYSIWYG Editor
- Components
- Snippets
- Custom 404 Page
🎨 Themes
- Theme Installation
- Theme Creation
- Step-by-Step Tutorial
- Template functions
- Template Tags
- Template Code Snippets
- Partial Template Files
🔌 Plugins
- Plugin Installation
- Plugin Creation
- Plugin functions
- Plugin Hooks & Filters
- Using Tabs and Sidebar Menus
- Tips & Tricks
💪 Advanced