How to use PHP code into HTML and JS files

Chema

Verified User
Joined
Jun 5, 2008
Messages
7
Hi!

I'm a new DirectAdmin user, and I don't know how to instruct Apache to recognise PHP code embedded into HTML and JavaScript files (in addition to files with .php extension, recognise files with .html and .js extensions).

I've read the user manual, and I've tried 3 different methods in order to achieve this:

- With the "Apache handlers" option:
x-httpd-php php html js

- With .htaccess files:
AddType x-httpd-php .php .html .js

- With the "Mime Types" option:
application/x-httpd-php php html js

And no luck! :(

My hosting is using Apache 2.2.8 and PHP 5.2.5 with suPHP enabled.

I've searched through the forum too...

Thanks in advance :)
 
Ok, thanks for your help.

I'd like to adjust the settings without modifying any file on the server.

I'm one of the technical administrators of this hosting, and I've full access to the "Custom HTTPD Configuration" of DA.

Anyone can explain me how to do this by using the Custom HTTPD Configuration of DirectAdmin?

Thanks again.
 
Back
Top