Customize 404 page.
- Edi
- Site Admin
- Posts: 3121
- Joined: Sun Aug 09, 2015 5:01 pm
- Location: Zurich
- Has thanked: 54 times
- Been thanked: 78 times
- Contact:
It's easy:
- Create a page.
- Go to "Settings" > "General" > "Advanced" and enter the name of the page in the field "Page not found".
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
- abdulhalim
- Master Bludit
- Posts: 128
- Joined: Thu Mar 10, 2016 6:25 pm
- Location: Bandar Abbas
- Been thanked: 4 times
- Contact:
Hello Edi,
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!
Is there any way to redirect to the HTML page?
Best Regards,
Abdulhalim
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!
Is there any way to redirect to the HTML page?
Best Regards,
Abdulhalim
just use apache's error document handler, and point to a static html with below command:
Code: Select all
ErrorDocument 404 /404.html
- abdulhalim
- Master Bludit
- Posts: 128
- Joined: Thu Mar 10, 2016 6:25 pm
- Location: Bandar Abbas
- Been thanked: 4 times
- Contact:
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
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
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
Basically you should check your access log, and see if the 404.html document is found in the path you use once you hit a "404 - page not found".
Otherwise try with one of below :
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
ps. I assume your webhosting provider uses apache webserwer, or at least has a port of htaccess directives interpreter.
- abdulhalim
- Master Bludit
- Posts: 128
- Joined: Thu Mar 10, 2016 6:25 pm
- Location: Bandar Abbas
- Been thanked: 4 times
- Contact:
Thank you, Jay
I used this command before, but this time it doesn't work, also I want to redirect from HTTPS to HTTP, this command doesn't work! but for non-www to www, it's OK.
Maybe there is an issue related to my server.
Thank you anyway
I used this command before, but this time it doesn't work, also I want to redirect from HTTPS to HTTP, this command doesn't work! but for non-www to www, it's OK.
Maybe there is an issue related to my server.
Thank you anyway
- Edi
- Site Admin
- Posts: 3121
- Joined: Sun Aug 09, 2015 5:01 pm
- Location: Zurich
- Has thanked: 54 times
- Been thanked: 78 times
- Contact:
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!
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
- abdulhalim
- Master Bludit
- Posts: 128
- Joined: Thu Mar 10, 2016 6:25 pm
- Location: Bandar Abbas
- Been thanked: 4 times
- Contact:
- Edi
- Site Admin
- Posts: 3121
- Joined: Sun Aug 09, 2015 5:01 pm
- Location: Zurich
- Has thanked: 54 times
- Been thanked: 78 times
- Contact:
Using the theme Blekathlon you can modify the loop with the titles in the file aside.php (in the directory /bl-themes/blekathlon/php) as follows if the slug of your error page is for example "error-404" (line 39):
instead of
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 ?>
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets