Mac OS 9 Lives

General => News, Information & Feedback => Topic started by: aBc on April 12, 2024, 12:59:48 PM

Title: Broken Links?
Post by: aBc on April 12, 2024, 12:59:48 PM
Is there a quick fix  / shortcut whereby individuals might possibly edit and correct broken links, other than reporting and requesting a fix? Or is it a manual, case-by-case occurrence scenario?

Here’s one:
http://macos9lives.com/smforum/index.php/topic,762.msg10461.html#msg10461 (https://macos9lives.com/smforum/index.php/topic,762.msg10461.html#msg10461)

Have encountered 4 or more today and don’t relish the idea of collecting and presenting an extensive list, if there’s possibly a simpler way or fix. ;)

Perhaps a stupid question - but I had to ask.
Title: Re: Broken Links?
Post by: ssp3 on April 12, 2024, 01:16:06 PM
I've raised this question before. Start from here:
http://macos9lives.com/smforum/index.php?topic=7031.msg54282#msg54282
Title: Re: Broken Links?
Post by: aBc on April 12, 2024, 01:28:40 PM
Thanks. So in essence, according to Knez that answer is no.

The only thing we can do at this point is to edit the posts we stumbled upon (ask a mod using the "report post" function) to change it to the technically original, unaltered link (the second link).

I can look into scripting the thing, but I'm not sure if it's worth the effort.

However, if I manually alter the slash to a "question mark" and the comma to an "equal sign" in the address; the prior linked page then loads.

(http://macos9lives.com/smforum/index.php?action=dlattach;topic=7066.0;attach=13788;image)

https://macos9lives.com/smforum/index.php/topic,762.msg10461.html#msg10461 (https://macos9lives.com/smforum/index.php/topic,762.msg10461.html#msg10461)

https://macos9lives.com/smforum/index.php?topic=762.msg10461.html#msg10461 (https://macos9lives.com/smforum/index.php?topic=762.msg10461.html#msg10461)
Title: Re: Broken Links?
Post by: ssp3 on April 12, 2024, 02:45:55 PM
Yes, it is that easy.
Later in that thread I suggested using something similar to BBEdit's multi file search and replace.
Although I know nothing about SQL databases, I still don't want to believe that there are no tools that can do something similar.

https://www.sqltutorial.org/sql-string-functions/sql-replace/
Title: Re: Broken Links?
Post by: Knezzen on April 13, 2024, 12:43:58 AM
I have been trying to narrow it down in a copy of the production database, so it's being worked on. It's my youngest sons birthday today, so I'll have more time to fiddle with it tomorrow.

But yeah, there's a function in simplemachines that "rewrites" the URL to something that was deemed more search engine friendly back in the early 2010's. Time has moved on and such rewrites are not compatible with newer web servers. Looking back at older posts, it was turned off in the very beginning and turned on some time around 2018 or so.

So it's either that we poke at the database, or edit every link in every post as we stumble upon them. Hacking up the web server to support this rewrite rule probably breaks something and running an old version of the web server just for the links is not really on the table.

We're using the "real" and "unmodified" URL's now, so the best solution and future safe solution is to use what we have now and edit the older posts manually or scripted to change them to the correct URL.
Title: Re: Broken Links?
Post by: Jubadub on April 13, 2024, 01:20:31 AM
Are all posts perhaps stored in a DB table? If so, couldn't all posts get mass-edited with some SQL string functions to detect when an URL begins and ends within a post, then apply the check/replace? (Assuming it supports SQL etc..)

Of course, there's no reason to rush it. :) We will go with whatever works better for you, since all of this takes your time more than anyone else's.
Title: Re: Broken Links?
Post by: Knezzen on April 13, 2024, 01:38:17 AM
Are all posts perhaps stored in a DB table? If so, couldn't all posts get mass-edited with some SQL string functions to detect when an URL begins and ends within a post, then apply the check/replace? (Assuming it supports SQL etc..)

Exactly, but it needs to be specific to overwrite only the correct URL's.
Title: Re: Broken Links?
Post by: Knezzen on April 13, 2024, 08:33:40 AM
Looking into this some more. There's 1159 posts with the "wrong" type of link URL and 976 posts with the type of link we have now (again).
Title: Re: Broken Links?
Post by: Knezzen on April 14, 2024, 02:28:01 AM
It looks like I solved this with the some configuration wizardry on the server side. Both types of links should be working now, without having to edit anything in the database :)
Title: Re: Broken Links?
Post by: Jubadub on April 14, 2024, 05:47:17 AM
Nice work! :)