# Stop inserting "index.php" with Apache + fastcgi?

**URL:** <https://help.nextcloud.com/t/stop-inserting-index-php-with-apache-fastcgi/9543>\
**Category:** ℹ️ Support\
**Created:** [March 1, 2017, 4:26pm UTC](https://help.nextcloud.com/t/stop-inserting-index-php-with-apache-fastcgi/9543 "2017-03-01T16:26:48Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![JasonMansour](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonmansour/32/3100_2.png) [@JasonMansour](https://help.nextcloud.com/u/JasonMansour)\
**Post date:** [April 12, 2017, 8:43am UTC](https://help.nextcloud.com/t/stop-inserting-index-php-with-apache-fastcgi/9543/9 "2017-04-12T08:43:14Z")

</div>

> [@X4LD1M0](#):
>
> The rewrite section in the .htaccess file will rewrite any ‘pretty’ incoming URLs to include index.php but the outgoing HTML code back to the browser won’t get rewritten to remove the index.php due to the restrictions of fastcgi and fpm.

Hi StephanW,  
I heard that before, could you please elaborate a bit? PHP code can write any URL it likes into HTML, I don’t understand how this can be a restriction from fastcgi. I thought maybe the issue was fastcgi not reporting the correct “clean” URL to PHP, but in my tests all the clean path, the original path, and the query parameters were available.

It seems to be rather a problem with the routing code or Symfony not detecting that short URLs are available. Somewhere in these files maybe?

```
lib/private/URLGenerator.php
lib/private/Route/Router.php
3rdparty/symfony/routing/Generator/UrlGenerator.php

```

My last experience with PHP is a long time ago so this is not so easy 🙂 but I think maybe I can at least create a config option to force short URLs.

---

_[View the full topic](https://help.nextcloud.com/t/stop-inserting-index-php-with-apache-fastcgi/9543)._
