How to Manage and Avoid Dead Links in My Portfolio?

0
2
Asked By CreativeCactus82 On

I'm diving into building my portfolio seriously and trying to figure out how to manage my links better. I thought about defining links in PHP at the top of my page, like this: `$mylink = haha_dot_com;` and using it in the HTML as `<a href="<?= $mylink ?>">descriptive text</a>`. Then I realized I was repeating the same link across different pages, which made me consider creating a central repository in JSON. It would have entries like `{"internal_name": "$mylink", "address": "haha.com", "locations": ["page1.php", "page2.php"]}`.

I would need a script to access this and ping each link to catch any that aren't returning a 200 status. If I do hit a dead link, all I'd need to do is update that one line. Is this approach too complicated? Do people actually do this?

3 Answers

Answered By TechyTom23 On

Honestly, I think you're overthinking it a bit. A lot of folks just keep it simple with direct links and check them manually now and then. But if you're enjoying the challenge, go for it!

ChillChick99 -

I second that! Just keep it simple unless you really need that level of detail.

Answered By OverkillMaster55 On

This might be a bit over-engineered, but if it's fun for you and you're learning, then I say go for it!

CreativeCactus82 -

Yep, I'm definitely enjoying the learning process!

Answered By LinkGuru45 On

I actually did something similar years ago but used a database instead of JSON. It had a column just for link status, which really simplified tracking them.

CreativeCactus82 -

Yeah, I’m considering the database too since my setup is already database-oriented. A status column sounds smart for monitoring!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.