# Slim 4 - HttpNotFoundException

**URL:** <https://discourse.slimframework.com/t/slim-4-httpnotfoundexception/3273>\
**Category:** Questions\
**Created:** [July 15, 2019, 6:36am UTC](https://discourse.slimframework.com/t/slim-4-httpnotfoundexception/3273 "2019-07-15T06:36:59Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Quentin](https://avatars.discourse-cdn.com/v4/letter/q/e47c2d/32.png) [@Quentin](https://discourse.slimframework.com/u/Quentin)\
**Post date:** [August 27, 2019, 7:52am UTC](https://discourse.slimframework.com/t/slim-4-httpnotfoundexception/3273/18 "2019-08-27T07:52:56Z")

</div>

Hi,  
this solution work fine for me without change pattern of routes :

Add $app-\>setBasePath("/ **youralias**");  
After AppFactory::create();

on the .htaccess verifiy this line :  
RewriteRule ^ / **youralias** /index.php [QSA,L]

source:

> <https://github.com/slimphp/Slim/issues/2512>

---

_[View the full topic](https://discourse.slimframework.com/t/slim-4-httpnotfoundexception/3273)._
