Customize 404 page.
Posted: Wed Jan 30, 2019 12:39 pm
How to customize 404 page. Thank you.
just use apache's error document handler, and point to a static html with below command:
Code: Select all
ErrorDocument 404 /404.html
I should guess, that easiest methods doesn't work in general.abdulhalim wrote: ↑Tue Feb 19, 2019 6:22 am Thank you, Jay
I put it into htaccess file, but it doesn't work, I think it needs to edit some of php file to redirect properly.
Regards,
Abdulhalim
Code: Select all
ErrorDocument 404 /absolute/path/to/html/document/on/your/webhost/account/404.html
Code: Select all
ErrorDocument 404 http://yourdomain/404.html
You can add a condition to the navigation, that excludes the 404 error page. Is it a normal or a static page?abdulhalim wrote: ↑Mon Feb 18, 2019 5:28 pm There is not fancy with 404 error page, I customized the template I used, I add author info box and etc to the page, Also the page shows in the menu!
Code: Select all
<?php foreach ($staticContent as $staticPage) : ?>
<?php if ($staticPage->slug() != "error-404") { ?>
<li class="menu-item">
<a href="<?php echo $staticPage->permalink(); ?>">
<?php echo $staticPage->title(); ?>
</a>
</li>
<?php } ?>
<?php endforeach ?>
Code: Select all
<?php foreach ($staticContent as $staticPage) : ?>
<li class="menu-item">
<a href="<?php echo $staticPage->permalink(); ?>">
<?php echo $staticPage->title(); ?>
</a>
</li>
<?php endforeach ?>