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.

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Image of Timescale

📊 Benchmarking Databases for Real-Time Analytics Applications

Benchmarking Timescale, Clickhouse, Postgres, MySQL, MongoDB, and DuckDB for real-time analytics. Introducing RTABench 🚀

Read full post →

👋 Kindness is contagious

Please show some love ❤️ or share a kind word in the comments if you found this useful!

Got it!