We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Return 404 status and 404 page when page is not exists

How Do I?

Houdini's avatar
Houdini
42 posts
8 months ago
Houdini's avatar Houdini

Hello,

I have a default template group index with index and 404 templates inside. Strict URLs is enabled, 404 page is point to index/404.

If I enter any random page, like: /hello-world it will render:

$ curl 'http://localhost:8080/hello-world' -I
HTTP/1.1 200 OK

What I expect is that it will show index/404 template with 404 http status. How to do this? Please help

       
Houdini's avatar
Houdini
42 posts
8 months ago
Houdini's avatar Houdini

Thanks for your reply. I agree with you.

But I didn’t get about server configuration — to me it does not and can’t affect 404 status. I think it’s something inside CMS settings, but the only CMS settings I found is Template Settings

       
Houdini's avatar
Houdini
42 posts
8 months ago
Houdini's avatar Houdini

I found the reason. In my case I didn’t specify nginx fastcgi_param SCRIPT_NAME directive. My problem solved. Thanks

? 1
       
Robin Sowell's avatar
Robin Sowell
13,255 posts
8 months ago
Robin Sowell's avatar Robin Sowell

Ouch- nice debug! Thanks for sharing the solution.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.