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

I was researching .htaccess on here, and decided to try this code I'd found:

RewriteRule ^([^\.]+)$ $1 [T=application/x-httpd-php-source] 

What does this do exactly? I know it's a rewrite rule, but what does the [T=] indicate?

I'm aware R is redirect, but this is a new one on me, so it'd be useful to know what this is.

Also, what do the regex symbols after RewriteRule indicate? I'm refreshing my knowledge on this, having realized I need good .htaccess skills for my project!

I understand some of mod_rewrite and .htaccess and have researched it myself, but this one is fairly new, so all help is appreciated.

Thanks

share|improve this question
    
    
Thanks for that, did look there. I knew the last bit, the MIME types. It was the part after RewriteRule with the dollar signs I'm not sure of... –  whitstone86 Jan 29 '11 at 23:49
    
That is a quite common regular-expression syntax. –  mattdm Jan 30 '11 at 0:01
    
I'm not trying to be a jerk here, but if your question is "how do I learn regular-expression syntax?", that's a different question than what you're nominally asking. (And probably off-topic.) –  mattdm Jan 30 '11 at 0:04
    
OK, this can be locked then, since I made a small mistake. Thanks anyway! :) –  whitstone86 Jan 30 '11 at 0:28

1 Answer 1

up vote 1 down vote accepted

T = set content-type (or MIME-type) header

share|improve this answer

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.