3
votes

I have a website consisting mostly of html webpages. In order to allow me to use php in them, in my .htaccess file I added a bit of parsing code. A few days ago the php somehow stopped being executed and I'm still not sure why. I googled a few things and tried a few different types of parsing code but nothing seems to work. At the moment I have this line in my .htaccess file:

AddType application/x-httpd-php .html .htm

I have noticed one thing though, the php works fine at http://turkishbasics.com (my site's home page) but doesn't work at all for any other directories like http://turkishbasics.com/index.html or /contact.html

I contacted the hosting company, the guy mentioned something about Apache.?

Just how do I solve this problem?

Thanks

2
Are your files *.php? Have you enabled *.php files in your Apache Config?George
Make sure that .htaccess file is in the root folder, and there are no other .htaccess files below it in other directories that would override that directive. Also that the .htaccess file has the proper permissions otherwise it will not be read/run.cryptic ツ

2 Answers

1
votes

If you havent yet heard of Apache then this might be a bit above you. Skip out the AddType decleration and just save your files with a .php extension instead of html

0
votes

To excute php code you need to write it in a php file (.php). Then execute the file in server.

You can not execute php code from html file (.html)

I guess when you execute http://turkishbasics.com it takes from http://turkishbasics.com/index.php