Skip to main content
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 ...
Sandwich's user avatar
  • 636
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' =&...
TRIM's user avatar
  • 314
4 votes

404 Error showing for Asset Images

Figured it out. I assumed that my assets folder needed 744 just as the install instructions mentioned for the Craft CMS folders. But, I need to change the permissions to the standard 755. Once I did, ...
DevServe's user avatar
  • 303
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 ...
Brandon Kelly's user avatar
4 votes
Accepted

Craft 3 Controller giving 404

Craft 3 action routes are snake-case rather than camelCase thus your route needs to be plugin-handle/controller-handle/function-name instead of pluginHandle/controllerName/functionName Your ...
Robin Schambach's user avatar
4 votes
Accepted

Template not found 404

Craft will serve one of 3 types of 404 errors. When Dev Mode is enabled, you will get something like this, which shows the full stack trace leading up to the NotFoundHttpException: If this looks ...
Brandon Kelly's user avatar
4 votes

Template not found 404

If you've set devMode to false in your local environment and you still can't see your 404 template, go to your own user account in the CMS and uncheck "Show full exception views when Dev Mode is ...
Ryan's user avatar
  • 1,972
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 ...
4midori's user avatar
  • 668
4 votes
Accepted

Basic 404 setup not working

If devMode is on, you will always see the above exception page. Turn it off to see your 404 page, or just navigate directly to the template, e.g. http://example.com/404 More here: https://nystudio107....
andrew.welch's user avatar
  • 11.6k
3 votes

Craft 3 404 and 503 pages in devMode

Just posting this here since I saw an official answer in Github: This changed in Beta 7: UserException reports are now styled like other exceptions when Dev Mode is enabled, with the full ...
Alex Kendrick's user avatar
3 votes

Template not found 404

There's a long discussion of all of this in the Handling Errors Gracefully in Craft CMS article, if it helps.
andrew.welch's user avatar
  • 11.6k
3 votes

See 404 error cause by some weird URI in index.php

These are very likely bots that are scanning the website for various things (I see it for WordPress logins a ton). Two things you can do: Redirect them. This is what I do for WordPress bots Install ...
andrew.welch's user avatar
  • 11.6k
3 votes

Security test generated large compiled_templates directory, site outage

I don't have specific answers to your questions, but that's mainly because I feel there are some clarifications and observations that I think might be more helpful. The thread you linked to is ...
Brad Bell's user avatar
  • 67.6k
3 votes

Can't access admin panel

I had the same issue on my mac and struggled for hours. Having the right .htaccess file in place was key, but if you are not getting Craft's error messages, that's a sign your .htaccess file is not ...
Topolino's user avatar
3 votes
Accepted

Redirecting "if entry is not defined" returns 404 instead

The reason you're getting a 404 is because Craft isn't even hitting your help/_entry.html template. Because there's no entry matching the URI /help/asdf, the template will never render and the request ...
Mats Mikkel Rummelhoff's user avatar
3 votes

Assets (images) return a 404 on the front-end

Just had a similar issue with a colleague. Double check your folder permissions. It might be the case that Craft isn’t allowed to write the transformed files to your assets folder. Something like ...
medoingthings's user avatar
3 votes

Can't Update CraftCMS

In Craft 3 and upwards you should have a vendor folder that is created and updated with composer. You would do the update locally (I recommend docker and ddev), which will update composer.json, ...
Max Strebel's user avatar
2 votes

Multi-locale pages 404 on subdirectories

I was running into the same issue, struggling with it and it turns out that the official documentation is a bit misleading (no offense) when it comes to the .htaccess file, because it just mentions to ...
Tobias S.'s user avatar
  • 127
2 votes

Can't access admin panel

As Brad Bell pointed out in a comment that you should use index.php, it might have something to do with your .htaccess and general.php Your .htaccess File should look something similair to this: <...
Justin Dekkers's user avatar
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 ...
Alexis Dalai Waldo Jiménez's user avatar
2 votes
Accepted

Ajax call to action 404

The URL you call using Ajax shouldn't include the action trigger, since Craft will add this to call the correct method in your controller when it interprets the URL. So in the example you gave, your ...
Steve Rowling's user avatar
2 votes

Template not found 404

Take a look in your general.php config file and see if you're overwriting the errorTemplatePrefix setting. It might look something like: 'errorTemplatePrefix' => "_errors/" So you might need to ...
Jamie Jenkins's user avatar
2 votes

Craft 2: Locale throwing 404 in frontend

However, when I try to access any page apart from the homepage in my 2nd locale in the frontend I get a 404 error. Could it be, that as a result of your settings, URL's for /en do not get rewritten ...
Paul's user avatar
  • 6,348
2 votes

Craft CMS 3 admin panel returns 404 with SSL

tl;dr: In my case, adding AllowOverride All back in to httpd.conf fixed the issue. I was having the same issue on my staging server. I noticed that, in addition to /admin throwing a 404, all of my ...
Andrea Hall's user avatar
2 votes
Accepted

Some (but not all) controller action routes return 404 on staging server

I figured this one out, it was bad error handling on my part. If the service you're calling returns NULL, this will appear in the network tab as a 404.
slander's user avatar
  • 73
2 votes

Control Panel or admin dashboard not found

You need to set the web server to host from the /web directory. At present it looks like you are serving a folder that contains the Craft folder.
dmatthams's user avatar
  • 2,502
2 votes
Accepted

Control Panel or admin dashboard not found

As @user suggested, Just create a virtual host by following the below mentioned steps. Complete Article : Virtual Host sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-...
inrsaurabh's user avatar
2 votes

{% Exit 404 %} doesn't work right with routes

When a route is accessed, entry isn't automatically defined. The actual value for * is available in the any variable in your template—see this example: Route: projects/type/(*) Template: _test {# ...
August Miller's user avatar
2 votes
Accepted

"Single" Entry page gives 404, even though it's enabled

This was occurring because I didn't have a template file for the page in question. I added it under /craft/templates/. All I had to do was copy another template used for news articles and adapt it to ...
GDP2's user avatar
  • 141
1 vote

Craft 2 -> 3 Update /admin 404

Is a lot of potential reasons for what issue may be. Is Craft handling the 404 error? If not, it could be your server is not pointing to the web/index.php properly. Can check that just putting a die('...
sanscheese's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible