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

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.


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
up vote 1 down vote accepted

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

share|improve this answer

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.