htaccess if statement

前端 未结 2 376
暗喜
暗喜 2021-02-04 08:02

I have the following line in my .htaccess file to select which version of PHP to use:

AddType x-httpd-php53 .php

This works great

2条回答
  •  醉酒成梦
    2021-02-04 08:55

    With Apache 2.4, it is easy with / directives (on %{HTTP_HOST}?).

    
        # configuration for foo
    
    
        # default configuration
    
    

    For Apache 2.2 and earlier, I would add a parameter to the startup command line of Apache (-D option) in one of the two environments then test if it is present or not via .

    To do this on Windows, with Apache started as a service, modify key registry HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Apache2.\ImagePath
    by appending -DFOO. Then, you can write:

    
        # configuration for foo
    
    
        # default configuration
    
    

提交回复
热议问题