1

I have my site hosted on a subfolder (ApplicationPath). I have ISAPI Rewrite to translate from www.domain.com/Subfolder to www.domain.com. The problem is that asp.net MVC Html.ActionLink() (and similar functions) generates URLS with www.domain.com/Subfolder. I want to be able to remove the "/Subfolder" from the URL as the ISAPI Rewrite will take care of making the link work. How do i do this? Please, i've tried it like a million times with no success.

4 Answers 4

1

In your route class override the GetVirtualPath method having it add "../" to the beginning of the Url property of the VirtualPathData object returned by the base.GetVirtualPath call.

Sign up to request clarification or add additional context in comments.

Comments

0

I don't believe there's a way to do this that is built in to the framework. You'll have to write your own Html helper extension method.

Comments

0

I think you should write your own Route class witch will rewrite URIs.

Comments

0

overriding the Route class didn't work, it doesn't handle the ApplicationPath. I think i have to override the GetVirtualPath of the RouteCollection class but i don't know how to do this.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.