Maison  >  Questions et réponses  >  le corps du texte

php - nginx下tp如何配置路由重写

index.php/Api/Sendems/sendCode.html
这个路径,apache可以加载.htaccess,进行路由重写
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
那nginx要怎么配置路由重写呢

阿神阿神2723 Il y a quelques jours621

répondre à tous(1)je répondrai

  • 阿神

    阿神2017-04-11 10:29:00

    配置文件中增加

     rewrite  ^(.*)$  /index.php?s=$1  last;

    répondre
    0
  • Annulerrépondre