eZ Community » Forums » Install & configuration » eZ cache and HTTP status codes
expandshrink

eZ cache and HTTP status codes

eZ cache and HTTP status codes

Thursday 21 November 2013 3:55:27 pm - 2 replies

Hi,

I ran into trouble while trying to set an HTTP status code of 403 to pages that users don't have access to. For example by object states. This happened on a site running eZ 5.0 legacy mode. (I'm guessing this is not limited to 5.0)

In error.ini I set

 [ErrorSettings-kernel]
HTTPError[1]=403

[HTTPError-403]
HTTPName=Forbidden

The first time such a page is requested, ( the page is not yet cached ) this works fine. I get a 403 status code. But the after the page is cached I get the normal 200 code.

When requesting a page that is not cached yet, the error module is ran if the user doesn't have access to that page and that module sets the desired header status. But then the page is cached and that module does not get ran.

How can I get the desired status code set even if the page is served from the cache?

Thank you.
-Juhana

Modified on Thursday 21 November 2013 4:01:40 pm by Juhana Soini

Thursday 21 November 2013 7:14:58 pm

Here are a couple of related issues that were patched:

https://jira.ez.no/browse/EZP-21547

https://jira.ez.no/browse/EZP-21737

However, the specific issue that you described might be this one, which is not yet solved:

https://jira.ez.no/browse/EZP-21682

Friday 22 November 2013 8:02:22 am

Thanks. Your first link had the solution.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from