DEV Community

Paul McGann
Paul McGann

Posted on • Edited on

Optimizely HttpErrors

I was recently investigating an issue reported by our team during development that they were unable to create certain blocks in our environments.

This reminded me of a Optimizely support article '409 conflict Creating page/block'

The suggestions listed on the site suggested to completely stop using the existingResponse="Replace" attribute upon HttpErrors section and use an alternative method.

Rather then implement this I decide to handle the HttpErrors differently only upon the scenario where we needed to.

To do this I decided to use the web.config location element to specify for a location e.g. 'episerver/cms' how I would like to handle the HttpErrors using snippet below.

<location path="episerver/cms">
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="PassThrough" />
</system.webServer>
</location>

Now on the front-end of the site we can use HttpErrors as we wish, and within the admin we can handle this differently and receive back the original HTTP response.

AWS Q Developer image

Build your favorite retro game with Amazon Q Developer CLI in the Challenge & win a T-shirt!

Feeling nostalgic? Build Games Challenge is your chance to recreate your favorite retro arcade style game using Amazon Q Developer’s agentic coding experience in the command line interface, Q Developer CLI.

Participate Now

Top comments (0)

Warp.dev image

The best coding agent. Backed by benchmarks.

Warp outperforms every other coding agent on the market, and gives you full control over which model you use. Get started now for free, or upgrade and unlock 2.5x AI credits on Warp's paid plans.

Download Warp

👋 Kindness is contagious

Explore this practical breakdown on DEV’s open platform, where developers from every background come together to push boundaries. No matter your experience, your viewpoint enriches the conversation.

Dropping a simple “thank you” or question in the comments goes a long way in supporting authors—your feedback helps ideas evolve.

At DEV, shared discovery drives progress and builds lasting bonds. If this post resonated, a quick nod of appreciation can make all the difference.

Okay