0
這是我想做什麼:阿帕奇ModRewrite正則表達式
/gestion/aa/ => /gestion/aa.php
/gestion/bb/ => /gestion/bb.php
/gestion/a/b/ => /gestion/a/b.php
/gestion/a/b/c/ => /gestion/a/b/c.php
/cmd/aa/ => /cmd/aa.php
/cmd/bb/ => /cmd/bb.php
/cmd/a/b/ => /cmd/a/b.php
/cmd/a/b/c/ => /cmd/a/b/c.php
/json/aa/ => /json/aa.php
/json/bb/ => /json/bb.php
/json/a/b/ => /json/a/b.php
/json/a/b/c/ => /json/a/b/c.php
這給我帶來了這個簡單的正則表達式:
^/(gestion|cmd|json)/(([^/]+/)*)$ /$1/$2.php [QSA,L]
親blem是$2
有總是內/
這樣的結果是:
/json/aa/ => /json/aa/.php
/json/bb/ => /json/bb/.php
/json/a/b/ => /json/a/b/.php
/json/a/b/c/ => /json/a/b/c/.php
任何想法如何得到正確的正則表達式?