# Media Files not loading 404 Error

**URL:** <https://forum.mautic.org/t/media-files-not-loading-404-error/22467>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [January 24, 2022, 2:52pm UTC](https://forum.mautic.org/t/media-files-not-loading-404-error/22467 "2022-01-24T14:52:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blowfish](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/blowfish/32/6443_2.png) [@blowfish](https://forum.mautic.org/u/blowfish)\
**Post date:** [January 24, 2022, 2:52pm UTC](https://forum.mautic.org/t/media-files-not-loading-404-error/22467/1 "2022-01-24T14:52:09Z")

</div>

**Your software** is v4.1.1  
_My PHP version is_ : 7.4.3  
_My MySQL/MariaDB version is_ (delete as applicable): MySQL/MariaDB version 10.3.31

**Your problem**  
_My problem is_ :  
I’m trying to edit a email segment campaign but i can not see any pictures which are already available in a template. I get 404 errors on the development console and also in the mautic nginx logs.

_These errors are showing in the Mautic log_ :  
root@vmd81698:/var/log/nginx# tail -f mautic.error  
2022/01/24 15:05:55 [error] 2343442#2343442: \*11 open() “/var/www/html/mautic/index.php/media/images/avatar.png” failed (20: Not a directory), client: something.something.something.something, server: [server-mautic.domain.com](http://server-mautic.domain.com), request: “GET /index.php/media/images/avatar.png HTTP/1.1”, host: “[server-mautic.domain.com](http://server-mautic.domain.com)”

_Steps I have tried to fix the problem_ :  
I tried to modify the try\_files configuration without any success till now.

configuration for nginx on location / is  
try\_files $uri /index.php$is\_args$args;

based on this whenever we would like to open a picture should be reflected as [https://mautic.domain.com/index.php/themes/brienz/assets/brienzlake.jpeg?v9318a97f](https://mautic.domain.com/index.php/themes/brienz/assets/brienzlake.jpeg?v9318a97f) but is 404 error.  
If i try to open the file in the following link it works  
[https://mautic.domain.com/themes/brienz/assets/brienzlake.jpeg?v9318a97f](https://mautic.domain.com/themes/brienz/assets/brienzlake.jpeg?v9318a97f)

I tried to query google to provide more details but i end up not finding any solutions.

Thanks,  
Adrian

---

<div class="post-metadata">

**Author:** ![blowfish](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/blowfish/32/6443_2.png) [@blowfish](https://forum.mautic.org/u/blowfish)\
**Post date:** [January 24, 2022, 2:56pm UTC](https://forum.mautic.org/t/media-files-not-loading-404-error/22467/2 "2022-01-24T14:56:45Z")

</div>

Issue fixed.  
The site URL was ending up with index.php, which shouldn’t be the case.

---

<div class="post-metadata">

**Author:** ![hlfh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hlfh/32/6976_2.png) [@hlfh](https://forum.mautic.org/u/hlfh)\
**Post date:** [May 6, 2022, 9:13am UTC](https://forum.mautic.org/t/media-files-not-loading-404-error/22467/3 "2022-05-06T09:13:35Z")

</div>

Great, I also had the same issue, and I removed the index.php suffix from the site\_url line in mautic/app/config/local.php. It worked.

---

<div class="post-metadata">

**Author:** ![weasam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/weasam/32/679_2.png) [@weasam](https://forum.mautic.org/u/weasam)\
**Post date:** [January 6, 2023, 10:13am UTC](https://forum.mautic.org/t/media-files-not-loading-404-error/22467/4 "2023-01-06T10:13:51Z")

</div>

This works for me as well, thanks for your posting that help me
