apache.htaccessmod-rewriteadd-type

Is it possible to have .htaccess rules for a specific domain?


Is there a way of having an AddType command only apply on certain hosts?

Specifically: AddType x-httpd-php54 .php

There's a lot of questions about having different RewriteRule definitions for different domains and you can do that with RewriteCond but is there an equivalent for non-rewrite related stuff?


Solution

  • You can probably use T flag of mod_rewrite like this:

    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)somdomain\. [NC]
    RewriteRule \.php$ - [T=application/x-httpd-php54]