index.php/api/sendems/sendcode.html
这个路径,apache可以加载.htaccess,进行路由重写
options +followsymlinks
rewriteengine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/ [QSA,PT,L]
那nginx要怎么配置路由重写呢
index.php/api/sendems/sendcode.html
这个路径,apache可以加载.htaccess,进行路由重写
options +followsymlinks
rewriteengine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
那nginx要怎么配置路由重写呢
配置文件中增加
<code> rewrite ^(.*)$ /index.php?s=$1 last;</code>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号