由于php項目中使用了重寫,訪問的時候是沒有.php的,在nginx中要把.php帶上即:將地址的第一級目錄都加上.php,如:“h ttps://xxxx.cn/index/article/acat?id=5” 變成:“h ttps://xxxx.cn/index.php/article/acat?id=5”
“h ttps://xxxx.cn/store/index?id=5” 變成:“h ttps://xxxx.cn/store.php/index?id=5”
請問這個正則替換怎么寫?
正則表達式替換url中的一級目錄的字符串
慕的地6264312
2019-03-12 02:37:25