nginx配置问题

http://localhost/niushop/index.php?s=/goods/goodsinfo/goodsid/43 



http://localhost/niushop/index.php/goods/goodsinfo?goodsid=43


上面两个路由是一样的,但是第二个无法执行,不知道要配置什么
阅读 2k
1 个回答
location / {                 
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
}

或者:

location / {
    # Check if a file or directory index file exists, else route it to index.php.
    try_files $uri $uri/ /index.php;
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题