tags:

views:

134

answers:

3

I am using Godaddy Deluxe hosting which allows me to host several websites in a single hosting account. The main website is hosted in the root of the hosting account and the rest of the websites are hosted in a subfolder in the form /hosting/websitename.

If I deploy an MVC app under a virtual directory, I get ugly looking URLs like:

http://www.mywebsite.com/hosting/mywebsite/Home/About

Note the /hosting/mywebsite part. For some reason the Html.ActionLink helper method infers the real hosting path which is exactly what I want to avoid. The URL should look like:

http://www.mywebsite.com/Home/About

The problem is easily reproducible by creating a new MVC application and changing the folder of the dev server from root (/) to something else (such as /hosting/).

How can I go about that apart from purchasing a new Godaddy hosting account?

A: 

Do you need to run multiple sites in your account? If not, ask godaddy how to make your MVC site the root.


This is easily fixable from a techinical level, but not with the constraints that you indicate exist at GoDaddy.

Ok, I'm not personally familiar with godaddy's hosting options, but your best bet might well be to take your business elsewhere where you can have multiple root-running applications as GoDaddy seems a bit limiting here. Or just purchasing a separate account for the application if you want to get expedient.

Wyatt Barnett
Yes, I am running multiple websites on a single hosting account otherwise I could just purchase an additional account and voila, problem solved.
vbocan
A: 

I've used GoDaddy quite a bit but I have yet to do this exact scenario you mentioned, but...

Have you tried to go to "IIS Management" from the control panel and set whatever directory your serving your MVC app from to the application root? I believe you just click on the edit button for the virtual directory and a dropdown appears where you can set that directory as an application root. Let me know if that works.

DM
The directory is an app root. Godaddy sets that by default when adding a new domain to the hosting account.
vbocan
A: 

Although not the definitive answer, there is a hack that does the trick. It's posted right here on SO.

vbocan
Your link goes to this same message
burnt_hand
Thanks @burnt_hand for letting me know that the link was broken. I fixed it. (Now I figured the downvote :-) )
vbocan
Upvoted, so that the answer at least has a neutral rating. :)
Jan Aagaard