cherryontech / website

Official website of the cherryOnTech squad!
https://cherryon.tech
MIT License
9 stars 41 forks source link

Portfolio site leads to 404 #147

Open TishG opened 2 years ago

TishG commented 2 years ago

Yikes! Briefly, what seems wrong? When I click on "Portfolio", I am taken to the url https://cherryon.tech/bio/[users name]/[portfolio website url], page says "404 not found"

Expected Behavior You should be taken to the portfolio website

Current Behavior Get 404 not found error image

Possible Solution Any ideas how to fix it? Tell us here!

Steps to Reproduce

  1. Go to https://cherryon.tech/about/
  2. Click on the word, "site" for a card that has site on the lower right hand corner
novellac commented 2 years ago

I think the issue is that the URLs are getting processed as relative if they don't start with http or https. To debug, I did the following:

  1. Used the Chrome Vue extension, I checked to see which component is responsible for printing the link. We are printing the link in two places - in About.vue and Biopost.vue.
  2. I noticed that the URLs which don't work lead to a URL with what looks like an exact address at the end. I looked through our codebase for one of these exact addresses (e.g. www.juliethfajardo.com) and found that they're attached to a portfolio_url. Looking through the codebase for portfolio_url shows me entries in both About.vue and Biopost.vue. This doesn't discover anything new, but further corroborates what I found with dev tools.
  3. In one of the bio markdown files (I used tish-g.md), I noticed the changed the portfolio_url to preface the url with https://. When I go back to the page, the link now works as expected. Conclusion: URLs aren't getting processed as absolute unless they're prefaced with http or https. What can we do about it? One option might be to see if we can edit our Forestry CMS configurations to validating them as URLs.(we can't, I tried) Another option would be to write a small utility function which would append https on urls that don't have it.
TishG commented 2 years ago

I think the issue is that the URLs are getting processed as relative if they don't start with http or https. To debug, I did the following:

  1. Used the Chrome Vue extension, I checked to see which component is responsible for printing the link. We are printing the link in two places - in About.vue and Biopost.vue.
  2. I noticed that the URLs which don't work lead to a URL with what looks like an exact address at the end. I looked through our codebase for one of these exact addresses (e.g. www.juliethfajardo.com) and found that they're attached to a portfolio_url. Looking through the codebase for portfolio_url shows me entries in both About.vue and Biopost.vue. This doesn't discover anything new, but further corroborates what I found with dev tools.
  3. In one of the bio markdown files (I used tish-g.md), I noticed the changed the portfolio_url to preface the url with https://. When I go back to the page, the link now works as expected. Conclusion: URLs aren't getting processed as absolute unless they're prefaced with http or https. What can we do about it? One option might be to see if we can edit our Forestry CMS configurations to validating them as URLs.(we can't, I tried) Another option would be to write a small utility function which would append https on urls that don't have it.

Thank you. I like the idea of writing a utility function that appends https to the urls.