# How to deploy slim4 to apache server subfolder?

**URL:** <https://discourse.slimframework.com/t/how-to-deploy-slim4-to-apache-server-subfolder/4085>\
**Category:** Questions\
**Created:** [April 22, 2020, 5:34pm UTC](https://discourse.slimframework.com/t/how-to-deploy-slim4-to-apache-server-subfolder/4085 "2020-04-22T17:34:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leossmith](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/leossmith/32/1109_2.png) [@leossmith](https://discourse.slimframework.com/u/leossmith)\
**Post date:** [April 22, 2020, 5:34pm UTC](https://discourse.slimframework.com/t/how-to-deploy-slim4-to-apache-server-subfolder/4085/1 "2020-04-22T17:34:47Z")

</div>

So I am almost done with my new Slim 4 API and i am trying to move it from xampp to a live server. I am using a shared server and the app will go to a subfolder with the following structure:

public\_html/mydomain.com/apps/slim-api/ (this contains all the files).

I tried moving it and creating an .htaccess with this:

```
RewriteEngine On
RewriteBase /mydomain.com/apps/slim-api
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

```

But doesnt seem to work (404 error). What am i doing wrong?

This is the complete error i get:

```
[23-Apr-2020 11:08:41 CST6CDT] 404 Not Found
Type: Slim\Exception\HttpNotFoundException
Code: 404
Message: Not found.
File: /home/tours/public_html/mydomain.com/apps/slim4-api/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php
Line: 93
```

---

<div class="post-metadata">

**Author:** ![dee-u](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@dee-u](https://discourse.slimframework.com/u/dee-u)\
**Post date:** [April 29, 2020, 2:19pm UTC](https://discourse.slimframework.com/t/how-to-deploy-slim4-to-apache-server-subfolder/4085/2 "2020-04-29T14:19:49Z")

</div>

Try following the tutorial here: [https://akrabat.com/running-slim-4-in-a-subdirectory/](https://akrabat.com/running-slim-4-in-a-subdirectory/)

It has helped me deploy my Slim API
