App Proxy - Trigger 404

shopjb
Tourist
8 0 1

Is there a way I can trigger the 404 page inside my App Proxy? Just returning a 404 status only shows a blank page.

Replies 3 (3)

Not applicable

Hi @shopjb ,

Here's a thought you can send Liquid syntax in an App Proxy response. So if you're able to send 404 why not copy the merchants 404 template code then send it as a response?

Here's some reference material: https://shopify.dev/tutorials/display-dynamic-store-data-with-app-proxies#proxy-response

Best, 

Sam - Owner @ Achieve Applabs

shopjb
Tourist
8 0 1

That works. Thanks!

alexrusin
Shopify Partner
5 0 5

Sending Liquid syntax for 404 didn't fit our case, because our app is installed on multiple Shopify stores. Different stores may have different 404 Liquid syntax.  Since Shopify doesn't trigger 404 template on 404 status, but follows 3xx redirects, we did a workaround by returning a redirect to a non-existing page 

res.redirect('/page-not-found')