企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
1、在配置文件 main.php 中添加 ~~~ 'urlManager' => [ //用于URL路径化 'enablePrettyUrl' => true, //指定是否在URL在保留入口脚本 index.php 'showScriptName' => false, ], ~~~ 2. vhosts.conf 配置 添加下面这句话到vhosts里 ~~~ if (!-e $request_filename){ rewrite ^/(.*) /index.php last; } ~~~ 参考: ~~~ server { listen 80; server_name frontend.com ; root "E:/phpStudy/WWW/Project/advanced/frontend/web"; location / { index index.html index.htm index.php; #autoindex on; #在这里添加这一行 if (!-e $request_filename){ rewrite ^/(.*) /index.php last; } } 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; } } ~~~