I've recently had to put some code into a different server and my .htaccess file fails miserably. I can stripe out all the parts I don't need but the thing is I'd like to have it on source-control (one file serves many scenarios).
Can we have fail-safe rules? I think I'm looking for an if else
clause here.
# IF THIS IS ALLOWED DO IT #
AuthType none
Satisfy any
# IF 开发者_运维知识库THIS IS ALLOWED DO IT #
DirectoryIndex index.htm index.php
AddHandler php5-script .php
I think there is an <IfModule> thing in htaccess:
<IfModule mod_auth_basic.c>
AuthType basic
Satisty any
</IfModule>
<IfModule mod_php.c>
DirectoryIndex index.htm index.php
AddHandler php5-script .php
</IfModule>
but I don't think there is an module for AuthType
... The IfModule !mod_a.c
checks if mod_a.c NOT exists.
However, I don't know if there are version checks and try-catches.
精彩评论