Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I understand .htaccess and mod_rewrite on a fairly basic level, and have just started learning ForceType and SetHandler directives.

This is my .htaccess file for my domain, testsite1.localhost (only accessible via 127.0.0.1 as indicated in the URL):

<Files .+*^$[]()>
ForceType application/x-httpd-php
SetHandler application/x-httpd-php
</Files>

What does the part after files mean? For some reason it seems to work, although I'm not sure why.

Please can someone help? I've been learning about this off Google, but other users' experience with this is welcomed!

Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The regular expression does not look well-formed, and even if it parsed it would not be able to match any string as far as I can tell, since some of the components of it are contradictory (sequence of 1-or-more of any characters, followed by beginning of a line will never match).

If this is Apache 2.0 or later, you can test a regex with the "pcretest" tool that comes with the regex library used by Apache.

"man pcresyntax" will show you the basics of regular expressions, but that particular regex will never make sense.

I assume the entire thing is a no-op. Don't use anything with Type in it to tag files as being handled by PHP -- SetHandler alone is sufficient.

share|improve this answer
    
It's on Apache 2.2, for the record. –  whitstone86 Jan 24 '11 at 19:29

Your Answer

 
discard

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.