I have a hosting package with a subdirectory named 'subdirectory' set up as an application on Discountasp.net and www.abc.com pointing to the root. I have a web.config in the root with the following <rule name="Rewrite rule" stopProcessing="true"> <match url=".*"/> <conditions> <add input="{HTTP_HOST}" pattern="^(www.)?abc.com" /> <add input="{PATH_INFO}" pattern="^/subdirectory/" negate="true"/> </conditions> <action type="Rewrite" url="/subdirectory/{r:0}" /> </rule> This seems to work fine. Entering www.ABC.com results in http://www.abc.com/default.aspx in the url window. So far so good. However, when I click say an image button, then after the postback it shows in the url http://abc.com/subdirectory/default.aspx instead of http://abc.com/default.aspx I've read and read about this and it seems that the following should work in the Form_Load in my page Form1.Action = Request.RawUrl It isn't working. I also tried Form1.Action = Request.RawUrl.Replace("/subdirectory", "") and it isn't working either. I also tried Form1.Action = "" same result. I've watched my variables (by displaying them on the page) and the form1.action is being set to just "default.aspx" for example, so that code is working, but my subdirectory still shows up in the URL. I thought about another rule where it would rewrite it based on if the url had 'subdirectory' in it - but that's not working either. I placed this before and then tried it after my above rule - <rule name="Rewrite remove name" > <match url="(.*)/subdirectory/(.*)" ignoreCase="true"/> <action type="Rewrite" url="/{r:0}" /> </rule> I suppose I could live with it showing the subdirectory, but I'm moving it from another location and I'd hate to have all my links now have my subdirectory name in it. Plus then if I move it again and I don't need the subdirectory in it at the new place then I'm stuck changing the names again. Plus it seems like other people are getting this to work. So I must be missing something. I realize I could just move it out of the subdirectory to the root but that defeats the purpose of the urlrewrite and hosting more than one domain. Any ideas would be appreciated.