George Woodiwiss Hill
George Woodiwiss Hill

Reputation: 13

Is it possible to have a file ignore an htaccess file?

I am using the folling line of code in my .htaccess file:

AddHandler application/x-httpd-php .htm

The reason for this line is that the need for PHP is new. Adding this line to .htaccess is quicker and has less impact than changing every file extension to PHP.

However, there is a slight issue. One of our samples we want to demonstrate on the site does not render properly. It does when the line of code above is removed.

So is it possible to get that one sample folder to ignore the htaccess file in the site root?

Thanks

Upvotes: 0

Views: 144

Answers (1)

cleaver
cleaver

Reputation: 370

There's a couple of approaches I'd consider for this. The first is to add a second .htaccess file in the directory containing HTML only—this could use the SetHandler directive to override the php handler set in the root of the application.

EG (.htaccess in the HTML-only directory):

SetHandler default-handler

The second approach would be to use the <Directory> in the root .htaccess directive to set the handler.

EG (.htaccess in the document root):

<Directory /var/www/HTMLonly>
    SetHandler default-handler
</Directory>

Upvotes: 1

Related Questions