1

I am creating a blog with an index page that links to individual blog show pages. I'm having a weird issue where when I click on the title on the index page
instead of it linking to: my_current_website.com/blog/blog_post_title
it is linking to: my_live_website.com/blog/blog_post_title,
which doesn't even exist. Any thoughts on why this would occur?
In the template I am setting up the link with entry.url.

1

The cause of this issue with a 90% likelyhood are your craft settings

Before you try any of the below steps, try clearing your cache first!

Sometimes some leftover cache is all that needs to be removed to fix an issue... rm -rf runtime/* or ./craft clear-caches/all

3 Settings which you may have set wrongly:

All of the below mentioned settings should basically be pointing towards my_current_website.com, a reference to that or something more relative like a simple /.

There are 3 Places where you should check if you have my_live_website.com set as your current host/site.

  1. .env's SITE_URL, BASE_URL or anything else that has SITE or URL in it's name
  2. config/general.php's siteUrl Value(s)
  3. Your Craft Control Panel Settings, my_current_website.com/admin/settings/sites (URL may differ based on config/general.php's cpTrigger value)
| improve this answer | |
  • Thanks for responding! Unfortunately I double checked all those things and my problem seems to be persisting. – Rain Dec 10 '19 at 19:08
  • Hmm if it's none of the above, are your entry URLs relative or absolute (and can they contain "other" websites' URLs)? Because if that's the case, then it's quite likely that you have a full URL leading to my_live_website.com/blog/blog_post_title set as your entry.url for the entry you're testing right now. – Campiotti Dec 11 '19 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.