Haroldo
Haroldo

Reputation: 37377

htaccess : make directories exceptions from auto_prepend?

Is there a way to make my auto_prepend command ignore my includes/ and ajax/ directories?

I can write regular expressions easily it's just knowing how to markup the conditional statements...

# choose which files are mother files (aka not includes or ajax)
# add dochead to these files
{some kind of regex conditioon here }
php_value auto_prepend_file  C:/wamp/www/new_glaven_valley/views/components/doc_head.php

Upvotes: 2

Views: 427

Answers (3)

Maarten
Maarten

Reputation: 4671

php_value auto_prepend_file none

Upvotes: 0

symcbean
symcbean

Reputation: 48367

Yes - use LocationMathc or directoryMatch but my prefrence would be to use a stub file as the auto-prepend and select further includes based on the value of $_SERVER['REQUEST_URI'] in my php code - its a lot easier to describe complicated structures and relationships using a procedural language than a config file - and you don't need to reset your webserver every time you want to change / save the settings.

C.

Upvotes: 1

timdev
timdev

Reputation: 62904

Why not just stick .htaccess files in your includes/ and ajax/ directories that unset auto_prepend_file (or if that can't be done, you could always have those directories auto_prepend an empty file.

Upvotes: 0

Related Questions