htaccess中apache接受的变量

时间:2017-03-17 19:05:09

标签: apache .htaccess

我正在使用以下内容:

<If "%{REQUEST_URI} =~ m#^.*\.(htm|html|php|txt)$#i">

...

<If "%{QUERY_STRING} =~ m#^.*TTT.*$#i">

我想知道Apache在.htaccess文件的这个子句中接受的所有变量。如果我收到像XXX这样的自定义标题,我如何在上述条件中使用它?

1 个答案:

答案 0 :(得分:0)

列出表达式check this official Apache documentation中的所有可用变量。

要检查自定义标头,请使用:

public static final int BOATS_ARR_INDEX = 0;
public static final int CARS_ARR_INDEX = 1;

Vehicle[][] vehicleArrs = new Vehicle[2][];
vehicleArrs[BOATS_ARR_INDEX] = boatsArrayGeneratingMethod();
vehicleArrs[CARS_ARR_INDEX] = carsArrayGeneratingMethod();

for (Vehicle[] vehicleArr : vehicleArrs){
    // do whatever you want to do for all Vehicle objects here, iterating through vehicleArr
}

Boat[] boats = vehicleArrs[BOATS_ARR_INDEX];
//do you original code from the question here