


How to solve the TP6 error 'The current access route is not defined or does not match'
Jun 29, 2020 pm 05:50 PM下面由thinkphp框架教程欄目給大家介紹ThinkPHP 6.0 多語言優(yōu)化擴(kuò)展包,希望對需要的朋友有所幫助!
如果是報路由錯誤,則說明啟用了路由控制,那么所有被訪問的頁面都需要配置路由,否則將無法訪問。
例如:
在瀏覽器中運行http://hml.tp6.com/admin/getlog
報錯:當(dāng)前訪問路由未定義或不匹配
已設(shè)置過路由:
原因:當(dāng)前訪問方式是post,在瀏覽器中無法模擬訪問,必須在apipost中訪問。改成get方式也可以。
另注意:如果是多應(yīng)用模式架構(gòu)的話,路由要帶上模塊名,如admin。如圖所示目錄層級。
如圖:訪問成功
如果報404錯誤,一般是客戶端的問題,url輸入有誤,將你的域名后加上index.php試下,例如你需要訪問的路由是:
http://hml.tp6.com/admin/getlog,那么你可以寫成這樣:http://hml.tp6.com/index.php/admin/getlog
這種情況設(shè)置一個偽靜態(tài)即可,在thinkPHP根目錄下的public下添加一個文件nginx.htaccess,添加如下代碼:
if?(!-e?$request_filename)?{ ??? rewrite??^(.*)$??/index.php?s=/$1??last; ?}
The above is the detailed content of How to solve the TP6 error 'The current access route is not defined or does not match'. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
