Web Hosting Workaround for monorail
So I recently needed to put an web app I wrote with monorail online. Ended up buying hosting through re-invent who have so far have been very good. The one big problem I soon realized was they (like pretty much every web hosting company) don’t support Castle Project and in particular Monorail. Basically whenever I tried to access a page it would just come up with a 404. So after many hours of hair pulling, I was about to give up and have a very painful rewrite in asp.net. Luckily I had another search on the forums and found out that most web hosting companies will block any non standard file names, i.e. .castle. So using the url rerouting in monorail, I just added the following rule
<routing>
<rule>
<pattern>(.+)(.aspx)</pattern>
<replace><![CDATA[ $1.castle ]]></replace>
</rule>
</routing>
After I added that, I found that everything worked perfectly. There are some problems with it, namely that in methods like RedirectToAction() it will add the castle extension. As a current workaround I have just add the following to the base controller:
protected new void RedirectToAction(string action)
{
Redirect(action + “.aspx”);
}
I know its not the most elegant solution, but its better than nothing. Hope this helps some people!