# \[Solved\] How to instruct Slim 3 not to halt on unmatched routes

**URL:** <https://discourse.slimframework.com/t/solved-how-to-instruct-slim-3-not-to-halt-on-unmatched-routes/2544>\
**Category:** Questions\
**Created:** [July 16, 2018, 7:11pm UTC](https://discourse.slimframework.com/t/solved-how-to-instruct-slim-3-not-to-halt-on-unmatched-routes/2544 "2018-07-16T19:11:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![a\_k](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/a_k/32/715_2.png) [@a\_k](https://discourse.slimframework.com/u/a_k)\
**Post date:** [July 16, 2018, 7:11pm UTC](https://discourse.slimframework.com/t/solved-how-to-instruct-slim-3-not-to-halt-on-unmatched-routes/2544/1 "2018-07-16T19:11:44Z")

</div>

Hey there!

I’m trying to integrate Slim 3 with a WordPress website, where I’m essentially running Slim before/in front of the main website (using the auto\_prepend\_file rule in the .htaccess file to execute Slim before WP is loaded).

Whenever a WP page is requested, I would like to run some tests in Slim and if the tests pass, silently go away and allow the WP application to process as usual. For some routes such as /api/\*, I would like to have slim take over and function as normal.

The problem seems to be that if a route is not matched, a 404 page is shown and that automatically halts the request.

Is there any way to instruct Slim 3 not to halt the page execution is a route is not found? I tried to follow [the answers on this post](http://help.slimframework.com/discussions/problems/1085-how-to-instruct-slim-not-to-halt-on-unmatched-routes) for Slim 2 but not able to make much progress with Slim 3.

Any help would be much appreciated.

Thanks!  
Ananda

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [July 16, 2018, 8:33pm UTC](https://discourse.slimframework.com/t/solved-how-to-instruct-slim-3-not-to-halt-on-unmatched-routes/2544/2 "2018-07-16T20:33:09Z")

</div>

They way I’ve seen this handled by others is only when you can determine which app should handle the request by the route itself. For example if all of the `/api/*` routes and `/slim/*` routes are handled by Slim then you can point them to Slim’s front controller, otherwise they get sent to WP’s front controller.

Otherwise, I can’t think of how you might handle that, though there might be ways. However it was actually done it would likely involve writing your own [404 Not Found Handler](https://www.slimframework.com/docs/v3/handlers/not-found.html) in Slim which would somehow pass along the request to WP, perhaps just by including WP’s front controller?.?

---

<div class="post-metadata">

**Author:** ![a\_k](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/a_k/32/715_2.png) [@a\_k](https://discourse.slimframework.com/u/a_k)\
**Post date:** [July 17, 2018, 8:01am UTC](https://discourse.slimframework.com/t/solved-how-to-instruct-slim-3-not-to-halt-on-unmatched-routes/2544/3 "2018-07-17T08:01:09Z")

</div>

Thanks @tflight for your response. I did a little digging around and found that the `run()` method in Slim\App.php accepts the `$silent` parameter. As the name suggests, passing `true` makes Slim run silently without halting execution or sending any output. This solved my problem!
