开发者

fail-safe .htaccess?

开发者 https://www.devze.com 2023-01-15 05:18 出处:网络
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

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.

0

精彩评论

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