# Problem with hosting the API on my Synology

**URL:** <https://discourse.slimframework.com/t/problem-with-hosting-the-api-on-my-synology/2058>\
**Category:** Questions\
**Created:** [November 30, 2017, 1:51pm UTC](https://discourse.slimframework.com/t/problem-with-hosting-the-api-on-my-synology/2058 "2017-11-30T13:51:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dejavu](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dejavu](https://discourse.slimframework.com/u/Dejavu)\
**Post date:** [November 30, 2017, 1:51pm UTC](https://discourse.slimframework.com/t/problem-with-hosting-the-api-on-my-synology/2058/1 "2017-11-30T13:51:09Z")

</div>

I have already created a REST-API with SlimFramework which is hosted on XAMPP local on my PC. It is working perfect on my PC but when i want to put it on my “Live System” Synology NAS (Synology DS216+II) it always gives me an Error 404 and i have no clue why.

On my Synology NAS (Synology DS216+II) there is a Apache Server running (Version 2.2)  
Since i know that my API does not work on the Synology i tried to implement the “demo” example at [https://www.slimframework.com/](https://www.slimframework.com/)

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/slimframework/original/1X/0dd1f390e06edbaa22fc1798ed23f03372a87e6b.png)

Error Message Synology:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/slimframework/original/1X/8368b07e58987c610c9bbd79aaa2554b46187951.png)

Response when i call the same code on my PC with the local XAMPP:  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/slimframework/original/1X/6a214f83ed0847f69f0770be886bae428dba91d0.png)  
it does what it should do…

But why am I getting this Error on my Synology?  
I would be happy about some help

---

<div class="post-metadata">

**Author:** ![odan](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@odan](https://discourse.slimframework.com/u/odan)\
**Post date:** [November 30, 2017, 3:23pm UTC](https://discourse.slimframework.com/t/problem-with-hosting-the-api-on-my-synology/2058/2 "2017-11-30T15:23:44Z")

</div>

The url should not contain the string `index.php`.

The src/\* folder is only for PHP class files reserved and should be “private”.  
Better put the `index.php` file into the `public` folder and define it as your DocumentRoot directory in apache.

`DocumentRoot /var/www/example.com/public`

Do you have a .htaccess in the `public` folder?

Content of `public/.htaccess`:

```auto
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

```
