FROM CACHE - en_header

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)
achieveapplabs
Shopify Partner
531 39 89

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

We make Shopify apps. Visit our site. | Looking for Shopify app development? achieveapplabs.com/#apps
shopjb
Tourist
8 0 1

That works. Thanks!

alexrusin
Shopify Partner
4 0 1

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')