本篇內容介紹了“Nginx怎么配置PATHINFO隱藏thinkphp index.php”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
nginx配置pathinfo隱藏index.php
nginx配置文件里放入這段代碼
server { listen 80; default_type text/plain; root /var/www/html; index index.php index.htm index.html; #隱藏index.php location / { if (!-e $request_filename) { #一級目錄 # rewrite ^/(.*)$ /index.php/$1 last; #二級目錄 rewrite ^/myapp/(.*)$ /myapp/index.php/$1 last; } } #pathinfo設置 location ~ \.php($|/) { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param path_info $fastcgi_path_info; fastcgi_param script_filename $document_root$fastcgi_script_name; include fastcgi_params; } }
“Nginx怎么配置PATHINFO隱藏thinkphp index.php”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。