国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Regular expression - nginx regular expression, how to match not ending with / and not ending with .xml .html .htm
過(guò)去多啦不再A夢(mèng)
過(guò)去多啦不再A夢(mèng) 2017-05-16 17:25:48
0
2
1001

need

Requires a regular expression, used in nginx.
If $uri does not end with / and does not end with .xml, .html, or .htm, it will be permanent to $uri/.

location @rewrite {
    rewrite [^\/]$ $uri/ permanent;
    rewrite . /index.php?s=$uri&$args last;
}

try

My own writing method, but failed:

rewrite ([\/]|.xml|.html?)$ $uri/ permanent;

Question

1)如何才可以實(shí)現(xiàn)不以.xml .html /結(jié)尾的才重寫(xiě)的正則。
2)如何才可以在正則表達(dá)式[]中排除完整的一段單詞?

Replenish

I used this sentence, and it seems that no problem has been found for the time being.

rewrite [^\/|\.xml|\.html?]$ $uri/ permanent;

Question, isn’t a-zA-Z0-9 in the square brackets []? Can you also write a complete matching string?

過(guò)去多啦不再A夢(mèng)
過(guò)去多啦不再A夢(mèng)

reply all(2)
洪濤

What you need is a regular expression engine that supports union, intersection, and difference: http://nfabo.cn/p/?p=1280
In nginx, you can only use negation to reverse look around: .*(?<!.xml|.html|.htm|/)$

巴扎黑

You can rewrite these files ending in .html, .htm, and .xml to their original directories first,
The rest is achieved by applying your rewrite rules.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template