Is there a way to just have php parsed in a single file rather than in all files ending in a particular extension?

For example, I know that

AddType application/x-httpd-php .html

will parse all .html files using the php parsing engine

But I want to only parse abc.html and not anythingelse.html I am thinking this is the directive

AddType application/x-httpd-php abc.html

but it does not work like I want it too.

Is what I am trying to do possible?

link|improve this question

44% accept rate
feedback

2 Answers

up vote 1 down vote accepted

Just put your AddType directive inside a Files or FilesMatch container to only apply it to specific files.

link|improve this answer
That was exactly the answer. I tested it and it did just what I needed. Thanks joschi. – Dr. DOT Oct 2 '10 at 10:55
feedback

What about using mod_rewrite (.htaccess file) for the trick instead ?

RewriteEngine On
RewriteRule ^abc.html$ abc.php [L]

So when people go to www.yourdomain.com/abc.html they will actually be seeing abc.php, you can aswell hide abc.php somewhere else.

This is a internal redirection so only you would know where abc.php is.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.