.htaccess 在web.config中重写URL不适用于子目录中的Slim PHP API

.htaccess 在web.config中重写URL不适用于子目录中的Slim PHP API,.htaccess,iis,url-rewriting,slim,url-rewrite-module,.htaccess,Iis,Url Rewriting,Slim,Url Rewrite Module,我使用WAMP堆栈(Windows+Apache+MySQL+PHP)和SlimPHP微框架开发了后端应用程序。它在WAMP中工作得很好,但现在我必须让它在使用IISV7.5的服务器中工作,并且我得到了一个HTTP404错误 前端是一个位于根目录(这里没有问题)中的AngularJS应用程序,它使用从位于/API/v0子目录中的SlimPHP API获得的数据 以下是我的web应用程序的结构: Project |--index.html |--styles (direc

我使用WAMP堆栈(Windows+Apache+MySQL+PHP)和SlimPHP微框架开发了后端应用程序。它在WAMP中工作得很好,但现在我必须让它在使用IISV7.5的服务器中工作,并且我得到了一个HTTP404错误

前端是一个位于根目录(这里没有问题)中的AngularJS应用程序,它使用从位于/API/v0子目录中的SlimPHP API获得的数据

以下是我的web应用程序的结构:

Project
|--index.html
|--styles              (directory with .css files)
|--views               (directory with .html partial views for angularJS)
|--scripts             (directory with .js angularJS scripts)
|--api
   |--composer.json
   |--vendor
      |--autoload.php
      |--slim          (directory with slim framework files)
   |--v0
      |--index.php     (SlimPHP application)
      |--.htaccess     (Apache configuration file)
      |--web.config    (ISS configuration file)
  • .htaccess(Apache配置)
重新编写引擎打开
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$%{ENV:BASE}index.php[QSA,L]
RewriteCond%{HTTP:Authorization}+
重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]
  • web.config(IIS配置)

但我不知道如何更改web.config


这是我第一次使用和IIS服务器,我花了很多时间研究并尝试使其工作,但没有成功。

位于
Project/api/v0/
中的此配置文件
web.config
适用于我:


这几乎适用于我。适合/product manager/api/v1/products,但不适合/product manager/api/v1/products/961有什么想法吗?