Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Apache doesn't let .htaccess use frills such as Location, Directory - without these, is it possible to match a url pattern and set php configuration settings (via php_value) in a .htaccess file?

share|improve this question

You can, however, use Files and FilesMatch in a htaccess file.

share|improve this answer
The problem is you can't match a URL pattern - so if something is handled through a single index.php / front controller it will have unwanted effects. – thinice Jan 12 '12 at 17:20
He didn't show a URL pattern - he showed a filename, file.php. – adaptr Jan 12 '12 at 17:46
Apologies - I was just trying to fill in my question a bit; it looks bare without some form of example. I didn't intend on contradicting my question. – thinice Jan 12 '12 at 17:53

Location and Directory don't make as much sense for .htaccess files because you can just put them in the directory that it matches to.

share|improve this answer
Unless a directory doesn't exist and everything is routed through a front controller – thinice Jan 12 '12 at 17:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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