The domain name is repeated in the URL of absolute links

The simple description of my problem is that I don’t now how to make an absolute link to a page within my site. When I do, the domain name is repeated (occurs twice) in the URL.

I have three sites in a shared IIS hosting account hosted by GoDaddy. Two of the three are subdirectories (separate domain names) of the main site. This problem exists for one of the two sites of which the contents are subdirectories.

I certainly know how to make relative links. The problem is that I have a menu in each page of the site. The same menu is included in every page. So if I create a relative link then that does not work because many pages are at different levels. If I create an absolute link as in:

/sample.com/subfolder

Then what I get (in the browser’s address) is:

http://sample.com/sample.com/subfolder

Is that normal? If it is then how do I fix it so I don’t get the domain repeated? If it is not normal then my IIS configuration is messed up somehow. What do I look at?

Okay, I will post the site. See Simple Samples. Does it not do for you what I say it does? Maybe it only happens in my system but it does for Edge, IE and Chrome.

That’s not an absolute link - it is one relative to the domain folder.

An absolute link starts with one of the following

http://
https://
//

I think it would be considered to be an absolute address, but I really think it does not help to discuss that here.

Even if I use “http://sample.com/subfolder” I get the same thing.

1 Like

Okay, I will post the site. See Simple Samples. Does it not do for you what I say it does? Maybe it only happens in my system but it does for Edge, IE and Chrome.

I don’t know about IIS, but it really seems to me like your URLs should be something like this:

/subfolder

That’s what you’d do on Apache, and it seems IIS is expecting the same thing. At the moment, it thinks you are pointing to a /sample.com/ folder in the root directory and a /subfolder/ folder within that.

Thank you, ralphm. I think I was using the format “/subfolder” but then it was not working and changed it.

Regardless, I get the same thing with that too. So I have probably messed up my IIS configuration. I did something stupid a couple of months ago; it was a mistake. Perhaps I am still suffering from that.

In case it helps, what I did was to download my entire site then uploaded it back but I uploaded to the wrong place. I will try looking at web.config file(s) and such but I might have to call GoDaddy and/or post in the asp.net web site.

1 Like

Ah, right. That’s tricky. Any reason you are using IIS? I stumbled on it by accident once (a client made a mistake in signing up for hosting) and I ran from it as fast as I could. :confounded:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.