Last post May 21, 2007 04:15 AM by ChadThiele
May 20, 2007 01:10 AM|ChadThiele|LINK
Anyone have experience with UrlRewriter.net?
Using UrlRewriter.Net, I can rewrite my urls from ugly (www.domain.com/Default.aspx?c=1234&d=5678) to pretty urls (www.domain.com/1234/5678). Here's my problem.
On the (cassini) web server built into Visual Studio 2005, the rewriting works fine. On my local, Windows XP SP2 (IIS 5.1), development box they don't. I don't fully qualify the urls in the rewrite config (I use the "~/"), so I don't see why it's acting
differently. Here's what my rewrites look like:
<rewrite url="^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.aspx)(\?.+)?)$" to="$1" processing="stop" />
<rewrite url="^~/SubDir/(.+)/(.+)$" to="~/SubDir/Default.aspx?c=$1&s=$2" />
Why does running the page from visual studio work, and running the page from iis doesn't? Any help is greatly appreciated.
May 20, 2007 06:13 AM|ChadThiele|LINK
Also doesn't work when uploaded to my shared host, godaddy.
Any ideas? I'm dying to get my updates loaded to my website. :)
May 21, 2007 01:12 AM|Svante|LINK
You probably need to enable wild card mapping in IIS. Presumably you're rewriting from pretty to ugly, i.e. expect
www.domain.com/1234/5678 to be served as if
www.domain.com/default.aspx?c=1234&d=5678 was requested. 1234/5678 is a non-existing path-less extension, and you need to tell IIS that ASP.NET are to handle requests to such paths. This is a wild-card
mapping, which the development server always has. You do this in the IIS settings applet, slightly differently in IIS 5 or IIS 6 - and possibly not at all at your web hotel...
May 21, 2007 04:15 AM|ChadThiele|LINK
I think you're right, I had a hunch that was the problem. I'll look into it and report back. If it's true, I'll be able to fix it locally, but on my hosting... ugh, I'm hoping GoDaddy will be accommodating without an upgrade to a virtual server.