1
votes

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)

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

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

The rule that I have specified is as follows:

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

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?

1

1 Answers

1
votes

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

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