Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis 7 在IIS7的URL重写中对文件夹进行优先级排序_Iis 7_Community Server - Fatal编程技术网

Iis 7 在IIS7的URL重写中对文件夹进行优先级排序

Iis 7 在IIS7的URL重写中对文件夹进行优先级排序,iis-7,community-server,Iis 7,Community Server,我们目前正在为我们的网站使用CommunityServer 最近的一项更改要求创建一个较短的URL来访问用户的配置文件页面。因此,如果我们的网站是www.example.com,我们希望用户配置文件页面可以通过www.example.com/username访问 为了确保现有文件夹/路径具有优先级,我将重写规则放在SiteUrls.config的末尾: <Override xpath = "/SiteUrls/locations/location[@path='/']" mode="add

我们目前正在为我们的网站使用CommunityServer

最近的一项更改要求创建一个较短的URL来访问用户的配置文件页面。因此,如果我们的网站是www.example.com,我们希望用户配置文件页面可以通过www.example.com/username访问

为了确保现有文件夹/路径具有优先级,我将重写规则放在SiteUrls.config的末尾:

<Override xpath = "/SiteUrls/locations/location[@path='/']" mode="add" where="end">
       <url name="userslug" path="" pattern="/([a-zA-Z0-9\-]+$)" physicalPath="/user/" vanity="{2}?slug=$1" page="userprofile.aspx"  />
</Override>

这在通过VS2010调试在本地环境中进行测试时非常有效。访问www.example.com/folder会被重定向到www.example.com/folder/,默认页面会正确显示

但是,当我们将更改部署到live时,访问www.example.com/folder会返回一个user not found错误,这意味着查找现有文件夹的优先级并没有被确定


我不确定要从我们的live server中提供什么相关信息,但有什么我应该看一下的,以使URL访问像在VS2010调试中那样工作吗?

显然,您所要做的就是创建一个URL重写规则,通过IIS向目录添加尾部斜杠