How to Remove Hosting Root directory name???
GC said 3 years, 2 months ago:
Hi There!
I recently purchased a Delux-Windows shared hosting plan (GoDaddy) which allows users to host multiple websites from the same account and more importantly allows domains to be pointed to any sub-directory within the hosting a/c.
I’ve created a sample trimed down project (created using VS 2008 Pro asp.net basic template) and following the domain Structure in the way I intend to use on the delux hosting a/c.
*******Domain******** ****Pointing to Directory*****
fake.smardy.in (fake Domain) -> (the Root)
anurakti.net -> sample
The website contents are uploaded under sample directory which is also configured to be the Application Root for the domain anurakti.net (Done automatically while pointing the domain to the directory and also confirmed using the Hosting provider’s IIS settings manager).
When I try to access any page on my website using the URL http://www.anurakti.net it gets me to the required web site.
But the ****PROBLEM being**** that somehow for any links that are created through the Web.sitemap and accessed through say menu control, they have their URL changed to a path that includes the hosting root directory name also i.e. “sample” in this scenario.
So in my case if I look at the URL’s created in the sample default.aspx page, for the links created using Menu/Sitemap control referring to for example Login.aspx , the path comes out to be (in the NOT Desired format)
http://www.anurakti.net/sample/Common/Login.aspx
which includes the directory hosting root path name “sample” (- this looks really UGLY) instead of coming out as (in the Desired format)
http://www.anurakti.net/Common/Login.aspx
Please note a similar link created using Hyperlink control shows the Login.aspx page URL in the Desired format.
My query thus being
1) Why are the 2 controls – Hyperlink & Menu control both showing different PATHS for the same URL?
2) Is there any specific Sitemap property configuration that needs to be done or any web.config setting that I might have missed out?
3) Shouldn’t the sub-directory act like the Root directory for my domain and hence not be visible in other URL paths inside my website?
Looking forward to the expert resolution…
Thanks in advance!
Gaurav
http://www.anurakti.com
scotty said 3 years, 2 months ago:
We have looked into our domain mapping functionality and have been unable to determine why the two controls you are using behave differently. The best resolution to this issue is to host each domain in the root of a single hosting site.
tusharthakker said 1 year, 3 months ago:
I have exactly the same problem. I can launch my site without the full path to the domain subfolder but eventually when I navigate through the site the full path starts showing up. Not sure why the subsequent pages start displaying the full path when it does work without even full path. I just want to get rid of the subfolder path.
http://www.rentafreelance.com/<anything> subsequently starts showing up as
http://www.rentafreelance.com/sites/rentafreelance/<anything> in the browser.
Tushar
dirq said 1 year, 1 month ago:
I also have the same problem. Honestly, I have never seen a ASP.NET site that didn’t use ~/ somewhere. How in the world could GoDaddy not have an easy way to fix this??
rj_123 said 1 year, 1 month ago:
I have the same issue. Has anyone found a solution to this?
timb said 1 year ago:
@rj_123
Due to the directory structure of a hosting account with secondary domains, the URL will show the full path. As @scotty mentions, you can host your domains in separate hosting plans on their own root directories. I also found a thread where another user was able to come up with a work around that was able to work for them:
http://forums.asp.net/t/1178037.aspx/1
Tim B
0 min expected wait time