# index.php is now added to my URL string

**URL:** <https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678>\
**Category:** Product Support\
**Created:** [August 6, 2018, 2:36pm UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678 "2018-08-06T14:36:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardmerry](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/richardmerry/32/178_2.png) [@richardmerry](https://forum.mautic.org/u/richardmerry)\
**Post date:** [August 6, 2018, 2:36pm UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/1 "2018-08-06T14:36:38Z")

</div>

My Mautic login URL has always been [https://www.domain.com/s/login](https://www.domain.com/s/login). I had to reinstall version 2.13 and now my login URL is [https://www.domain.com/index.php/s/login](https://www.domain.com/index.php/s/login)

Does any now what could have caused the extra index.php?

---

<div class="post-metadata">

**Author:** ![deepak](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@deepak](https://forum.mautic.org/u/deepak)\
**Post date:** [August 15, 2018, 10:04am UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/2 "2018-08-15T10:04:53Z")

</div>

Hi Richardmery,

Did you find the solution for this ??  
because I am also facing the same issue.

---

<div class="post-metadata">

**Author:** ![richardmerry](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/richardmerry/32/178_2.png) [@richardmerry](https://forum.mautic.org/u/richardmerry)\
**Post date:** [August 28, 2018, 4:49am UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/3 "2018-08-28T04:49:42Z")

</div>

@deepak - sorry for late reply. No, I did not find a solution. I had to go back to version 2.13 from my backup.

---

<div class="post-metadata">

**Author:** ![dominic.mayers](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dominic.mayers/32/13549_2.png) [@dominic.mayers](https://forum.mautic.org/u/dominic.mayers)\
**Post date:** [April 17, 2025, 4:25am UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/4 "2025-04-17T04:25:34Z")

</div>

Just to say that it happened to me in a fresh installation with `http://domain/` as original request. The redirected url was `domain://index.php/installer`. It seems to only happen when there is another issue with the installation. After the issue is removed, it also disappears. Yet, I have never seen an explanation for this that points to the code that adds the extra index.php before a path. It’s not even clear if it is added by the server or by Mautic. However, given that it happens as much with nginx as with apache and for many people, independently of their server configuration, it seems to be a feature of Mautic, perhaps of Symfony as well.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [April 20, 2025, 11:13am UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/5 "2025-04-20T11:13:35Z")

</div>

as far as i know the default installation for mautic is [domain.com/index.php](http://domain.com/index.php)

This can be changed in the Settings → Configurations → System Settings → Site URL,

with the index.php present and some web server configurations it causes issues seeing images and other broken links, you can remove the index.php and then the default becomes /s/login

---

<div class="post-metadata">

**Author:** ![dominic.mayers](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dominic.mayers/32/13549_2.png) [@dominic.mayers](https://forum.mautic.org/u/dominic.mayers)\
**Post date:** [April 20, 2025, 2:48pm UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/6 "2025-04-20T14:48:34Z")

</div>

That has to be a part of the explanation. Currently, in a fresh installation of 5.2, the site url in `config/local.php` is `https://domain.com`, without the leading `/index.php`. But I have seen configurations in which the site url is `https://domain.com/index.php`. It is interesting that Mautic accepts both, a leading `/index.php` or no leading `/index.php`, in the site url. I suspect the issue occurs only when there is a leading `/index.php` in the site url. I recall that the issue is not that internally the server rewrite the request to `https://domain.com/$request_uri` with a leading `/index.php` in `$request_uri`. This is of course necessary given that the script entry point is `index.php` in the root document. The issue is that we see an `index.php` in the url bar before the path as in `https://domain.com/index.php/installer`. Mautic does not normally expect that kind of request uri. I guess that it is created in a redirect that adds `/installer` after the configured site url, without first removing the extra leading `/index.php`.

---

<div class="post-metadata">

**Author:** ![dominic.mayers](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dominic.mayers/32/13549_2.png) [@dominic.mayers](https://forum.mautic.org/u/dominic.mayers)\
**Post date:** [April 26, 2025, 5:01pm UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/7 "2025-04-26T17:01:55Z")

</div>

Part of the explanation is this code of AppKernel, which is executed at installation :

```auto
              if (false === stripos($request->server->get('SERVER_SOFTWARE', ''), 'apache')
                    || !file_exists($this->getProjectDir().'/.htaccess')
                    && false === strpos(
                        $base,
                        'index'
                    )
                ) {
                    $prefix .= '/index.php';
                }

                return new RedirectResponse($request->getUriForPath($prefix.'/installer'));

```

It is flawed. It says that if it isn’t Apache (or if there is no .htaccess file and the base url contains `index`) then the prefix is `/index.php`. This prefix is added before the path `/installer`, but after the base url, in `getUriForPath($prefix.'/installer')` So, even if `/index.php` occurs in the base url, it will be added again in the redirect url. So, if you initiate the installation with `/index.php` in Nginx, unless the configuration has a workaround for this bug, you have a redirect to `/index.ph/index.php/installer` and this leads to a 500 internal error.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [April 27, 2025, 7:28am UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/8 "2025-04-27T07:28:17Z")

</div>

This is already above my pay grade, but maybe you should drop into and raise an issue in the Mautic github repository

---

<div class="post-metadata">

**Author:** ![dominic.mayers](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dominic.mayers/32/13549_2.png) [@dominic.mayers](https://forum.mautic.org/u/dominic.mayers)\
**Post date:** [April 28, 2025, 4:50pm UTC](https://forum.mautic.org/t/index-php-is-now-added-to-my-url-string/10678/9 "2025-04-28T16:50:15Z")

</div>

These are the kind of bugs that become features because they’ve been around for so long that some applications might even rely on the behavior created by the bug. Since workarounds exist, the bug is discovered the hard way, a workaround is used, and then it’s forgotten.
