I have a Craft site which seems to function properly but I see a 404 in the header http status code. I’ve located the following in the error logs:

2016/07/28 15:22:30 [error] [exception.Craft\HttpException.404] exception 'Craft\HttpException' in   /var/www/touchtunesmedia.com/craft/app/controllers/Templat$
Stack trace:
#0 [internal function]: Craft\TemplatesController->actionRender('home', Array)
#1 /var/www/touchtunesmedia.com/craft/app/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(Object(Craft\TemplatesController), Array)
#2 /var/www/touchtunesmedia.com/craft/app/framework/web/actions/CInlineAction.php(47): CAction->runWithParamsInternal(Object(Craft\TemplatesController), Obje$
#3 /var/www/touchtunesmedia.com/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#4 /var/www/touchtunesmedia.com/craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#5 /var/www/touchtunesmedia.com/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#6 /var/www/touchtunesmedia.com/craft/app/framework/web/CWebApplication.php(282): CController->run('render')
#7 /var/www/touchtunesmedia.com/craft/app/framework/web/CWebApplication.php(141): CWebApplication->runController('templates/rende...')
#8 /var/www/touchtunesmedia.com/craft/app/etc/web/WebApp.php(288): CWebApplication->processRequest()
#9 /var/www/touchtunesmedia.com/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#10 /var/www/touchtunesmedia.com/craft/app/index.php(62): CApplication->run()
#11 /var/www/touchtunesmedia.com/public/index.php(19): require_once('/var/www/toucht...')
#12 {main}

I have a home partial which is rendering fine so I’m having a hard time diagnosing where the error may be stemming from. Additionally everything returns a 200 status code in my network profiler other than the request for the document.

enter image description here

If I change the public dir’s index.php to echo test there is no 404 in the header status code. If I change my main layout template to a basic html file with nothing in it I get a 404 in the status code.


I resolved this by adding a new 'home' template which extends my main layout. This resolved the 404 in the header status code.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.