0

I have PHP scripts inside my HTMl file. I am using Apache. I created a .htaccess file and place it in my root directory of the application with the following as its contents

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

I want to allow the server to execute the PHP scripts inside the HTML files.

Thanks in advance.

7
Contributors
10
Replies
61
Views
3 Years
Discussion Span
Last Post by nturup
Featured Replies
0

Why not just rename the extensions to .php?

This means the server has to process all html files, whether they contain php or not. You can mod_rewrite urls if you don't want to see a file extension at all.

0

yea... am using windows.. I wanted to rename the extension to PHP but my supervisor didn't wanted it like that..

Thanks for your responses!

0

Hi,

As per my understanding you need all files are in .htm or .html but work like .php files.
i.e. aboutus.htm will work like aboutus.php, am I correct?

Please let me know.
Thanks,
Ajay

0

I had a talk with my supervisor and he said that he wanted to see if I would be able to figure it out. I got it to work. It turns out that I did not place the .htaccess file in the root directory.

But he told me that I can use the php extension for the application...

Thanks for your responses.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.