6
votes
Accepted
Craft not loading custom 404 template for errors
Turns out the general.php file had the following line (docs) in it:
'errorTemplatePrefix' => "_errors/"
Once I'd created the proper folder and files, all worked as expected.
Thanks, @CraftCMS ...
5
votes
Craft not loading custom 404 template for errors
It's quite possible that you are in Dev mode. If you switch to false, the 404.html may then be recognized…
Look at general.php, then change devMode to false.
// Dev environment settings
'dev' =&...
4
votes
Accepted
How to show homepage for 404 errors
404 isn’t a valid redirect status code, which is why {% redirect '/' 404 %} isn’t working correctly.
It sounds like you want to:
first issue a 301 or 302 redirect to the homepage
then serve the ...
4
votes
Accepted
How to route 404 errors for multi-site Craft?
I pondered this for a while, and then did this, which will direct us to specific entries (not templates, I don't want to create more of those):
{# We need a unique 404 for each site - just take us to ...
3
votes
404 problems, staging only
Looking at your screenshots, the host names are different. The cPanel 404 shows mysphotos instead of myphotos.
Probably a typo somewhere in your templates.
3
votes
devMode false, Internal Server Error
Cleared the log files found at /storage/logs/web.log.
Tried to view an inner page on the website which threw a Craft "Internal Server Error".
Inside the log, I saw "Twig\Error\SyntaxError: Unknown "...
3
votes
Accepted
404 page title SEOmatic
So it looks like you're using the old syntax for SEOmatic 1.x for Craft 2.x; here's how you do the same thing in SEOmatic for Craft 3:
{% do seomatic.meta.seoTitle("Some Title") %}
c.f.: https://...
2
votes
Accepted
404 error page not loading
So my issue was very simple to solve once I paid better attention. The 404 was loading perfectly fine the whole time, my problem was that in my 404 file I had it as {% block content %} and not {% ...
2
votes
Craft not loading custom 404 template for errors
Make sure you are in production mode in the .env file: ENVIRONMENT=production
Make sure you have developer mode disabled in config/general.php file: 'devMode'=>false
Make sure you have a 404.twig ...
2
votes
Accepted
404 problems, staging only
Probably your paths are not set up right; or the SERVER_NAME isn't what you think it is, so it's not matching the paths in your general.php
2
votes
Template not found: $PRIMARY_SITE_URL/$PRIMARY_SITE_URL/blog/this-is-my-blog
You have to go to your Admin Dashboard > Settings > Sites > Your site and delete Base URL field, then save it and try to navigate.
1
vote
Craft CMS shows disabled entry page
Try adding this to the beginning of your case study entry template:
{% if entry is not defined %}
{% exit 404 %}
{% endif %}
Do you have a route set up for your case studies?
I've got routing ...
1
vote
Can I define a path to my 404 template?
Here's more than you ever wanted to know on 404 and error templates in Craft CMS: Handling Errors Gracefully in Craft CMS
1
vote
What's the best way to set up a content-manageable 404 page?
This is something I discuss in the Handling Errors Gracefully in Craft CMS article, not just for 404s, but for a number of different status codes/errors.
The actual templating code then ends up ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
404-page × 23404 × 6
templating × 3
routing × 3
error-templates × 3
entries × 2
localization × 2
url × 2
error-message × 2
routes × 2
craft3 × 1
config × 1
error × 1
multi-site × 1
controller × 1
redirect × 1
pagination × 1
plugin-contactform × 1
channels × 1
plugin-seomatic × 1
singles × 1
multi-domain × 1
index × 1
devmode × 1