Redirect to 404 page

Hello there!

Can we redirect page to page-not-found if in the custom module we get null data of specific identifier which doesn’t exist?

@Dhruvi Will you please share the code from which you want to redirect to 404? I mean to from template file from module, etc…

If you want to redirect from the template file inside your module than follow the below code

1 Like

Thanks @chirag.viradiya I will try the same.