Mobile app version of vmapp.org
Login or Join
Deb1703797

: HTML files downloading rather than executing Trying to get a client's site up. The HTML files keep downloading rather than executing. I've done a MIME check and the files appear to be text/html.

@Deb1703797

Posted in: #Html

Trying to get a client's site up. The HTML files keep downloading rather than executing.

I've done a MIME check and the files appear to be text/html. I recreated the database admin, password and made sure that there was a connection between the script and the MySQL database. Permissions seem to be fine and the index.html is executable, permissions 755. Not sure where to turn next.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

1 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

When a web browser offers to download a file rather than open it, it is generally because the headers are incorrect. It sounds like you already checked the "Content-Type" header, but you also need to check the "Content-Disposition" header.

An easy way to check the headers on your page is to use the command line tool curl:

curl -s --head 'http://example.com/'


The "Content-Type" header should start with "text/html". There should be no "Content-Disposition" header. If you see something like this, you will need to configure your server to remove it:

Content-Disposition: attachment; filename="file.html"

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme