External Links in Ghost Blog Return 404 page

I have create a new Ghost blog, and when I create a new post with external links, they return a 404 page on my ghost blog. For example, I create a link, linking to mailgun.com, after I publish the post and click on the link, it returns a 404 page on my ghost blog. Why is that? How can I fix it?

I am not good with editing themes. This seems like it should be a simple fix right?

Hello @IndustryExperts. To better assess you situation, I’d need to know:

  1. what theme you are using;
  2. what is the URL of the page that yields a 404 code.

Also, let’s suppose you’re editing a post. You highlight a portion of text, press ctrl+k, and then

  1. what do you type in the URL field?

If you manage to answer all three questions, there are higher chances to sort this through :slight_smile:

  1. Theme is Casper. The default theme for Ghost.
  2. This is any blog post I create. I create a blog post and I have tried linking to many different websites and they all bring up a 404 page when they are clicked on.
  3. In the URL field for example I would type in mailgun.com

Here is a test post for you too check out -
https://industryexperts.co/here-is-test-post/

Hey @IndustryExperts

Zrzut ekranu 2020-06-21 o 00.49.43

Instead of ‘mailgun.com’, use ‘https://mailgun.com’.

Very weird indeed! Apparently, it’s trying to parse it as a internal link even though it has a trailing .com signature. I fear that’s not because of the theme, but because of Ghost itself. Could you please try to change it to https://mailgun.com and see how that goes?

I tried adding https in front of it and it worked.

May I ask why it does that? Can I change it?

I will have lots of writers writing on my website and I dont know if they will know to do that

Without prefixing the URL with https:// or http:// the browser will assume the page is an internal page. The prefix isn’t automatically applied incase the editor actually wants to link to an internal page :slight_smile:

Hi there, I just want to point out here that this is quite unintuitive for nontechnical editors.

What would be your solution? :slightly_smiling_face:

Hmm, maybe some kind of additional form element on the url entry popup such as a checkbox next to the url field for the editor to specify whether a link is external/internal.

Or even just some helper text under the url field. I don’t think the ux(ui?) of link entry would suffer from being expanded, including even possibly having a button to submit the edit vs only hitting return.

This issue is still present as of the latest version of Ghost. If you type a link in without https://, ghost will interpret it as an internal / relative link — so if you want to link from www.myghostwebsite.com/page1 to www.myghostwebsite.com/page2, you either have to type the link in as “/page2” OR https://www.myghostwebsite.com/page2.

Simply typing www.myghostwebsite.com/page2 will output a URL as “www.myghostwebsite.com/page1/www.myghostwebsite.com/page2” which will generate a 404 page.

This seems to me like a bug, and should probably be classified as such?