So I'm trying to configure my .htaccess
file so that it can runs the PHP code inside the HTML files.
When I go to mysite.com/thefile.php
, it runs it correctly without any problem. Same if I go to mysite.com/thefile.html
. But if I add <?php echo "Hello"; ?>
inside the HTML file, it doesnt display anything. In fact, when I right click "View source code", it displays the php lines.
Here's what I tried with my .htaccess
file:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .html .htm
I also a tried with just
AddType application/x-httpd-php .php .html .htm
But it displays a "500 Internal Server Error" that says:
The server encountered an internal error or misconfiguration and was unable to complete your request.
The most common causes of this problem are errors in the app's .htaccess file or incorrect file or directory permissions preventing the web server from reading the .htaccess file.
More information about this error is available in the app's Apache error log at:
/srv/users/SYSUSER/log/APPNAME/APPNAME_apache.error.log
I'm quite new to web development in general, and I want to mention that, except from these 2/1 lines in the .htaccess file, I have nothing else. Maybe I'm missing some lines in it? Just a guess
Thanks guys (and gals if they exist!)