Uploaded files not being served on Drupal site

Website URL

https://genuineimitation.infinityfree.io/

Error Message

GET https://genuineimitation.infinityfree.io/sites/default/files/inline-images/homepage.jpg 500 (Internal Server Error)

Other Information

I’ve just setup an existing drupal site on infinityfree but the uploaded files are not being served. I’ve checked htaccess and permissions. I don’t know what else could be the problem? The files do exist and I see here what happens when navigating to it directly: https://genuineimitation.infinityfree.io/sites/default/files/inline-images/homepage.jpg

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

I can’t open your link, so I don’t know what the page shows when you go to it directly. What does the browser display at the image URL? For example, is it a plain “500 Internal Server Error” page, a “Something Went Wrong!” page from us, or a Drupal-styled error page? The text on the page tells us whether the error comes from the web server, from .htaccess, or from Drupal. That points to very different fixes.

Could you also paste the contents of the .htaccess in htdocs and any .htaccess inside sites/default/files? You said you checked them, but the exact rules are what show whether a rewrite or a PHP-handling rule is catching image requests.

There’s a similar recent topic about images returning a 500, but it doesn’t have an answer yet, so I can’t say the cause is the same.

htacess in files directory:

Turn off all options we don’t need.

Options -Indexes -ExecCGI -Includes -MultiViews

Set the catch-all handler to prevent scripts from being executed.

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>

Override the handler again if we’re run later in the evaluation list.

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003

If we know how to do it safely, disable the PHP engine entirely.

php_flag engine off

I’m not sure what you’re trying to do, but your site seems to be working fine:

If you’re trying to access your site with a script, that’ll be blocked by the security system, and there is no way to disable that.

Some images that are within the theme are working. If you scroll down there is an image within the body text which is not loading: https://genuineimitation.infinityfree.io/sites/default/files/inline-images/homepage.jpg

If you open the console you’ll see 500 errors. The image exists and htaccess files are correct for Drupal.

Okay so looks like in the htaccess file in site/default/files commenting out disabling the PHP engine entirely resolved the issue and is not required only if supported which it appears not to be.

Glad its fixed :slight_smile: