Why is my README hyperlink going to the wrong URL?

I’m not understanding why markdown # [davelogear.github.io](davelogear.github.io) hyperlinks to https://github.com/davelogear/davelogear.github.io/blob/master/davelogear.github.io

I’m following this guide: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#links

For markdown links, you’ll typically need to use the full and complete URL. Try this instead:


Is that unique to GitHub?

Yes and no. The fact that davelogear.github.io links to [https://github.com/davelogear/davelogear.github.io/blob/master/davelogear.github.io](https://github.com/davelogear/davelogear.github.io/blob/master/davelogear.github.io) instead of [https://github.com/davelogear/davelogear.github.io/davelogear.github.io](https://github.com/davelogear/davelogear.github.io/davelogear.github.io) is specific to GitHub. The fact that davelogear.github.io links to [https://github.com/davelogear/davelogear.github.io/blob/master/davelogear.github.io](https://github.com/davelogear/davelogear.github.io/blob/master/davelogear.github.io) instead of [https://davelogear.github.io](https://davelogear.github.io) (assuming this text is in your README.md) is not.

When you specify a path in a link that has no slashes in it, it is considered to be a “relative URL” and, by default, is relative to the current document. If you want to point to the home page of a specific site, then you should use an absolute URL like @nadiajoyce specified: [http://davelogear.github.io](http://davelogear.github.io).

1 Like

 Lee, thanks for answering my question about http:// being required only in GitHub markdown, but I don’t know why you’d think I’d want the URL to go to either of those first two links you mention as they say 404 or ‘not found’, and don’t match the URL I was asking about.

Sorry for any confusion, @davelogear. I believe @lee-dohm was actually just referencing those links as the incorrect links (as mentioned in your original post) and then going on to explain why those links are generated when trying to create a text link without the full URL. 

Are links with reference-style link definitions discouraged on GitHub? It one of adam p cheatsheet, and I like it. I can’t find it on here 

I am about to continue writing on Github. I use atom and md-preview

to make preview the journal before pushing a commit (the shortcut dysfunction right now).

.When focus on writing it really handy if you could use reference-style link. [displayed-text][ref-url]

Just later we put the url.

No, they’re perfectly valid. You can find their definition in the spec. They’re also specifically mentioned in the first paragraph of the section you link to:

> In reference links the destination and title are defined elsewhere in the document.

I use them rather often in my own writing.