Forum Moderators: phranque

Message Too Old, No Replies

How to override ForceType in a given directory?

I have used ForceType application/x-httpd-php at the root level

         

spetracco

12:38 am on Nov 26, 2007 (gmt 0)

10+ Year Member



I have used ForceType application/x-httpd-php in the .htaccess file on my root directory as such:

# Force html files to be of type php:
<Files index.html>
ForceType application/x-httpd-php
</Files>

However, I have some directories with index.html files that should not be processed as PHP files. How can I either restrict my original statement to the current directory, OR override the setting with directory-specific .htaccess files? (I'm unsure of the syntax in the directory that would tell it to act like a regular HTML file).

Thanks,
Susan

jdMorgan

4:43 am on Nov 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Place a .htaccess file in the directory containing the files for which you want to remove the ForceType, containing either a RemoveType or a ForceType text/html .html directive.

See Apache mod_mime [httpd.apache.org] for more info.

Jim

spetracco

6:31 pm on Nov 26, 2007 (gmt 0)

10+ Year Member



Jim,

That worked great. Thanks for the fast help.

Susan