[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/04/2009 at 12:52AM PST, ID: 24870121 | Points: 125
[x]
Attachment Details

Have a line in htaccess only affect certain files

Asked by mycarefreepc in Apache Web Server, PHP Scripting Language

Tags: htaccess, apache, addhandler

I've got the following in my .htaccess file so that I can execute PHP on select HTML landing pages (for dynamic keyword insertion).

AddHandler application/x-httpd-php5 .html .htm

HostGator has the following to say about this:
It is highly recommended that you never allow html pages to automatically handle php or shtml, because this forces all of your html pages to be processed by the server first. Instead, please rename your files to .php or .shtml whenever possible.

Since this sounds like it will increase page load time slightly, is it possible to restrict the AddHandler to only specific files?

I've tried:

<files test1.html,test2.html> AddHandler application/x-httpd-php5 .html .htm
</files>

But this does not appear to work as the code does not execute when I do that.  Is this possible?
[+][-]11/04/09 01:33 AM, ID: 25737652

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 01:54 AM, ID: 25737751

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 06:18 PM, ID: 25764703

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/09 12:03 PM, ID: 25771648

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/11/09 09:05 AM, ID: 25796818

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625