Reputation: 27803
I've added the following XML to my SiteUrls.config
file:
<RewriterRule>
<SendTo>/pod/</SendTo>
<LookFor>.*abcdefg</LookFor>
</RewriterRule>
When I go to http://localhost/abcdefg
it successfully redirects me to http://localhost/pod
. My localhost is an IIS 7 web server.
However, I am unable to get this same exact configuration to work on our production or staging machines. It stays on http://staging.x.com/abcdefg
and gives a 404 error.
What exactly needs to be set up to allow this to work? I have not noticed much difference between the IIS modules I have locally and the IIS modules on the production/staging systems.
Upvotes: 2
Views: 963
Reputation: 155935
You may need to install a hotfix to support extensionless URLs on IIS 7.
Getting extensionless URLs working on IIS6 was tricky before and lots of been written on it. Early on in IIS6 and ASP.NET MVC you'd map everything . to managed code. ASP.NET Routing used to require RAMFARR set to true until the Extensionless URL feature was created.
Extentionless URLs support was added in this KB http://support.microsoft.com/kb/980368 and ships with ASP.NET MVC 4. If you have ASP.NET MVC 4, you have Extentionless URLs on your development machine. But your server may not. You may need to install this hotfix, or turn on RAMMFAR. I would rather you install the update than turn on RAMMFAR if you can avoid it. The Run All Modules options is really a wildcard mapping.
Upvotes: 1