日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

nginx给php做统一入口,Nginx如何来配置隐藏入口文件index.php(代码)

發布時間:2025/3/21 49 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx给php做统一入口,Nginx如何来配置隐藏入口文件index.php(代码) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

這篇文章給大家介紹的內容是關于Nginx配置 隱藏入口文件index.php,有一定的參考價值,有需要的朋友可以參考一下,希望對你有所幫助。

Nginx配置文件里放入這段代碼server {

location / {

index index.php index.html index.htm l.php;

autoindex on;

if (!-e $request_filename) {

#一級目錄

# rewrite ^/(.*)$ /index.php/$1 last;

#二級目錄,這里注意修改成自己的項目目錄

rewrite ^/rent/public/(.*)$ /rent/public/index.php/$1 last;

}

}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ \.php(.*)$ {

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

include fastcgi_params;

}

}

相關推薦:

ThinkPHP通過URL重寫隱藏應用的入口文件index.php

mvc模式中如何隱藏入口文件呢

PHP怎樣隱藏入口文件

總結

以上是生活随笔為你收集整理的nginx给php做统一入口,Nginx如何来配置隐藏入口文件index.php(代码)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。