IIS 7.0 URL 重写模块 - 根 URL 不显示 [英] IIS 7.0 URL Rewrite Module - Root URL doesn't display

查看:56
本文介绍了IIS 7.0 URL 重写模块 - 根 URL 不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 IIS 7.0 中设置一个 PHP 网站,并使用此模块启用 URL 重写 (http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1691)

I'm trying to setup a PHP website in IIS 7.0 with URL rewriting enabled using this module (http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1691)

对于网站的内部页面,我的整个过程都运行良好,但我的根 URL/"不再起作用.

I've got the whole thing running fine for inner pages of the site, but my root URL "/" doesn't work any more.

我希望我的 URL 的结构是 www.test.com/test-page.html 并将其重写为 www.test.com/index.php?page=test-page

I want the structure of my URLs to be www.test.com/test-page.html and this is rewritten to www.test.com/index.php?page=test-page

我指定的规则如下:

要匹配的正则表达式:^([^/.]+)/?.html重写为:/index.php?page={R:1}

Regular expression to match : ^([^/.]+)/?.html Rewrite to: /index.php?page={R:1}

正如我所说,它适用于所有内页,因此 www.test.com/test-page.html 加载没有问题,只是主页 www.test.com 不起作用.

as I said it works fine for all the inner pages so www.test.com/test-page.html would load no problem, it is just the homepage, www.test.com that doesn't work.

任何帮助将不胜感激,我假设我需要添加某种额外的条件?

Any help would be much appreciated, I'm assuming that I need to add some sort of extra condition?

推荐答案

试试 ^(?:([^/.]+).html)?$

try ^(?:([^/.]+).html)?$

这将使整个检查: 1 或多个字符 not/or not .后跟 .html 可选.

this will make the entire check for: 1 or many characters not / or not . followed by .html optional.

这篇关于IIS 7.0 URL 重写模块 - 根 URL 不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆