Rick Smith
Rick Smith

Reputation: 1241

Why does this url add my site name when clicking on it?

I noticed some 404's in my logs this morning so I took a look and found out that some links in my posts are adding my home page to the url that I linked to, thus creating a 404 . In the 2nd paragraph I link the word "readers" to one of our readers sites, and you'll see it adds my home page to the url and you get a broken page. If you view the source, this link isn't there. It's very strange, and happening in other places on my site as well. Any ideas what's going on, and how to fix this? Thanks.

http://noahsdad.com/big-tex/

Upvotes: 0

Views: 287

Answers (3)

bPratik
bPratik

Reputation: 7019

There are 2 types of links in relation to your site

  • Absolute
  • Relative

When you add links in your blog post to web sites/pages that are (in simple words) not the same site as the blog, then you are adding external links and need to specify the links as Absolute. To do so, you begin with the protocol, usually http:// or https://, followed by the address of the site/page. So for instance to link to Google.com your link would have to be http://www.google.com/

When you do not add a protocol/scheme in the link url, most browsers assume it to be relative links, i.e., relative to the page you are clicking them on. Remember though, that relative links are mainly a convenience, and all relative links can also be written as absolute links by simply including the scheme followed by the site hierarchy that precedes the page.

Hope that's given you a better understanding of links.

Upvotes: 0

Curtis
Curtis

Reputation: 103338

Rather than linking to www.pasticheyoga.com, link to http://www.pasticheyoga.com

Because there is no http://, https://, etc at the start of the URL, this URL is a relative URL, not an Absolute URL.

Upvotes: 1

Quentin
Quentin

Reputation: 943108

Since the URL doesn't start with http:// (or similar) it is a relative URI.

Include the scheme in the URI.

Upvotes: 2

Related Questions