Configuring ASP.NET MVC ActionLink format with GoDaddy shared hosting

Posted by Maxim Z. on Stack Overflow See other posts from Stack Overflow or by Maxim Z.
Published on 2010-06-09T18:49:01Z Indexed on 2010/06/09 18:52 UTC
Read the original article Hit count: 509

Filed under:
|
|
|
|

Background

I have a GoDaddy shared Windows hosting plan and I'm running into a small issue with multiple domains.

Many people have previously reported such an issue, but I am not interested in trying to resolve that problem altogether; all I want to accomplish is to change the format of my ActionLinks.


Issue

Let's say the domain that is mapped to my root hosting directory is example.com. GoDaddy forces mapping of other domains to subdirectories of the root. For example, my second domain, example1.com, is mapped to example.com/example1.

I uploaded my ASP.NET MVC site to such a subdirectory, only to find that ActionLinks that are for navigation have the following format:

http://example1.com/example1/Controller/Action

In other words, even when I use the domain that is mapped to the subdirectory, the subdirectory is still used in the URL.

However, I noticed that I can also access the same path by going to:

http://example1.com/Controller/Action

(leaving out the subdirectory)


What I want to achieve

I want to have my ActionLinks automatically drop the subdirectory, as it is not required.

Is this possible without changing the ActionLinks into plain-old URLs?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET