1. 程式人生 > >寶塔環境安裝thinkcmf5 開啟rewrite偽靜態方法

寶塔環境安裝thinkcmf5 開啟rewrite偽靜態方法

thinkcmf5寶塔liunx版Nginx環境開啟偽靜態步驟。

1、繫結網站執行目錄、

2、填寫偽靜態規則:

location / {
        index  index.php index.html index.htm;
         if (!-e $request_filename)
         {
            rewrite ^/(.*)$ /index.php?s=$1;
         }
    }
location /api/ {
        index  index.php index.html index.htm;
         if (!-e $request_filename)
         {
            rewrite ^/api/(.*)$ /api/index.php?s=$1;
         }
    }
location ~* \/upload\/.+\.(html|php)$ {
return 404;
}
location ~* ^\/plugins\/.+\.(html|php)$ {
return 404;
}
location ~* \/themes\/.+\.(html|php)$ {
return 404;
}

3、儲存,OK!