如何在(MAMP PRO for mac)中配置nginx上的僞靜態規則?try_file的值?tp5之URL重寫隱藏應用的入口文件index.php?

問題:

其實3個問題類似

1.MAMP PRO for mac中如何配置nginx中的try_file的值?

2.tp5.1在MAMP PRO中配置nginx的路由忽略index.php的重定向配置?

3.如何在MAMP PRO中配置nginx上的僞靜態規則?

環境:

     系統:mac mini v10.11.5

     MAMP PRO for mac : 4.4.1 (9605)

     tp版本:TP5.1.39

這是官方提供的nginx 上 URL重寫隱藏應用的入口文件index.php的規則:

location /youdomain/ {
    if (!-e $request_filename){
        rewrite  ^/youdomain/(.*)$  /youdomain/index.php?s=/$1  last;
    }
}

這是我的nginx 上 URL重寫隱藏應用的入口文件index.php的規則:

location /youdomain/ {
    if (!-e $request_filename){
        rewrite  ^/(.*)$  /index.php?s=/$1  last;
    }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章