开发者

Merging '<Files>' directives in .htaccess?

开发者 https://www.devze.com 2022-12-14 15:39 出处:网络
My .htaccess file looks like this: <Files misc> ForceType application/x-httpd-php </Files> <Files computers>

My .htaccess file looks like this:

<Files misc>
    ForceType application/x-httpd-php
</Files>

<Files computers>
    ForceType application/x-httpd-php
</Files>

<Files products>
    ForceType app开发者_运维知识库lication/x-httpd-php
</Files>

...and several more. However, given that the directive is called Files (i.e. plural), it seems like there should be a way to condense these all down to one rule.

How would I do that? I tried a few things like commas and pipes but nothing has worked thus far, when I load the pages it displays all my PHP code!


<Files ~ "^(misc|computers|products)$">
    ForceType application/x-httpd-php
</Files>
0

精彩评论

暂无评论...
验证码 换一张
取 消