Broken links from v1 to v2 docs & broken redirects Topic is solved

Share your ideas as to how the documentation can be improved.
gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Broken links from v1 to v2 docs & broken redirects

Post by gregster » 17 Dec 2022, 03:22

A number of links to v2 docs seem to be broken, when switching from the v1 docs. I get

Error.png
Error.png (8.78 KiB) Viewed 3321 times

Example: #warn -> click on v2 in the header -> error message
It links to https://lexikos.github.io/v2/docs/lib/_Warn.htm
Correct link would be https://lexikos.github.io/v2/docs/commands/_Warn.htm

Another example: KeyHistory
links to https://lexikos.github.io/v2/docs/lib/KeyHistory.htm -> error
Correct: https://lexikos.github.io/v2/docs/commands/KeyHistory.htm

There are much more...

On the other hand, coming from v2 seems to work, even then switching back to v2 from v1.

Pages from 'Usage and Syntax' seem to work, though.

guest3456
Posts: 3469
Joined: 09 Oct 2013, 10:31

Re: Broken links from v1 to v2 docs.

Post by guest3456 » 17 Dec 2022, 12:32

i'm seeing similar errors:
https://lexikos.github.io/v2/docs/lib/Catch.htm wrote: Error 404
The page you requested doesn't exist here.

AutoHotkey v2 documentation has moved to https://www.autohotkey.com/docs/v2, but if you're seeing this, then either the address is incorrect, or a redirect is missing.
broken: https://lexikos.github.io/v2/docs/lib/Catch.htm
working: https://www.autohotkey.com/docs/v2/lib/Catch.htm

so i'd guess that the v2 dropdown needs to fix the redirect link


gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Broken links from v1 to v2 docs.

Post by gregster » 17 Dec 2022, 12:59

Yes, the error message has changed today, so perhaps someone is working on it?

lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Broken links from v1 to v2 docs.

Post by lexikos » 17 Dec 2022, 19:18

"lib" is a recent change and wasn't intended to be pushed to autohotkey.com (but it was done automatically). I wasn't expecting there to be any links to v2/lib so haven't set up any redirects for it (actually, I think any such links were never valid). GitHub Pages doesn't have anything like .htaccess, so each redirect needs to be its own file (unless we do something tricky with the custom 404 page and JavaScript). All of the pages prior to this recent restructuring now redirect to autohotkey.com/docs/v2.

That was done last night (UTC+10) and I finished removing and redirecting the old autohotkey.com/docs this morning (1-2 hours ago).

TheBeginner
Posts: 91
Joined: 19 Oct 2018, 12:05

Bug on the site when clicking on some pages from search?

Post by TheBeginner » 18 Dec 2022, 04:37

there seems to be a bug on the site when searching for a function and trying to click it on the result some return an error page
image.png
image.png (54.58 KiB) Viewed 3168 times

gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Bug on the site when clicking on some pages from search?

Post by gregster » 18 Dec 2022, 04:51

Yes, eg in Firefox, I get the message that Firefox is not allowed to access the embedded page, and to instead open it in a new tab. In Edge, it fails as well, though less informative.
Might be related to some other changes which caused redirect problems, mentioned by @lexikos.


PS: I will move your post to yesterday's topic about broken docs - in the 'Suggestions on documentation improvements' subforum.
The subforum 'Forum Issues' might have been a good alternative for a report like this, while 'Bug Reports' is usually limited to bugs in the AHK language, not problems on the website, forums or the docs. But no worries... thank you for reporting!


Edit: Also reported here: viewtopic.php?f=3&t=111722

TheBeginner
Posts: 91
Joined: 19 Oct 2018, 12:05

Re: Broken links from v1 to v2 docs & broken redirects

Post by TheBeginner » 18 Dec 2022, 06:11

yeah, didn't know where to put it, as long as you know about it👍
you can still reach those pages through the topic navigation but not through the search

lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Broken links from v1 to v2 docs & broken redirects

Post by lexikos » 18 Dec 2022, 18:54

It is simply because the search index had not been rebuilt since the recent restructuring. Normally the search index is only rebuilt automatically, when an AutoHotkey release is published.

It has now been rebuilt.

gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Broken links from v1 to v2 docs & broken redirects

Post by gregster » 19 Dec 2022, 03:58

Thank you.

ThePeter
Posts: 49
Joined: 25 Oct 2022, 05:57

Re: Broken links from v1 to v2 docs & broken redirects

Post by ThePeter » 19 Dec 2022, 04:20

https://www.autohotkey.com/docs/KeyList.htm

is being redirected to Google...?

gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Broken links from v1 to v2 docs & broken redirects

Post by gregster » 19 Dec 2022, 04:33

That's because the link is not up-to-date. The docs are now split into v1 and v2 branches. Before, the v2 docs were only hosted on github, afaik.
Where did you find this link in the docs? Or is it a personal bookmark?

ThePeter
Posts: 49
Joined: 25 Oct 2022, 05:57

Re: Broken links from v1 to v2 docs & broken redirects

Post by ThePeter » 19 Dec 2022, 04:35

Found it in Google. But that's besides the point. The redirect should anyway not happen

gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Broken links from v1 to v2 docs & broken redirects

Post by gregster » 19 Dec 2022, 04:39

I guess, Google will update their index sooner or later. The docs were just restructured... and the v2 branch was added (previously on github).
If I remember correctly, invalid links have already been redirected to Google before. For example, if you applied the docs-tags to an unknown keyword.

ThePeter
Posts: 49
Joined: 25 Oct 2022, 05:57

Re: Broken links from v1 to v2 docs & broken redirects

Post by ThePeter » 19 Dec 2022, 05:01

There is absolutely no point redirecting invalid links to Google. If the invalid link cannot be redirected to a correct location, the user should be informed of the link's invalidity.

By the way,

https://www.autohotkey.com/docs/Hotkeys.htm

is correctly being redirected to v1. Why not KeyList?

safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: Broken links from v1 to v2 docs & broken redirects

Post by safetycar » 19 Dec 2022, 11:35

ThePeter wrote:
19 Dec 2022, 05:01
There is absolutely no point redirecting invalid links to Google. If the invalid link cannot be redirected to a correct location, the user should be informed of the link's invalidity
+1

guest3456
Posts: 3469
Joined: 09 Oct 2013, 10:31

Re: Broken links from v1 to v2 docs & broken redirects

Post by guest3456 » 19 Dec 2022, 12:10

we have the power to control the redirect of any link on our own domain. we shouldnt be redirecting to google


lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Broken links from v1 to v2 docs & broken redirects

Post by lexikos » 19 Dec 2022, 20:09

We have the power, and we are using it to redirect to a search function. Google search is more effective than most others, in my experience.

The redirect to search site:autohotkey.com/docs/ is for docs/whatever-you-want when whatever-you-want isn't in the documentation index.

Code: Select all

[docs]keyword[/docs]
keyword

The same redirection script strips ".htm" from the URL if present, before searching in the documentation index. I don't clearly recall, but I may have done this because I tend to type URLs like /docs/commands/functionname.htm and sometimes that wasn't working because functionname shared a page with some other function.

The redirection to search only happens if nothing is found in the documentation index. I suppose that it could redirect to the documentation's built-in search function instead.

There is absolutely no point redirecting invalid links to Google.
Does this behaviour offend you? Stating your opinion in absolutes like this is not helpful. If anyone finds the search results useful, there is a point, regardless of what you or anyone else personally consider to be correct, or any other reasons for or against.


As for KeyList.htm, the redirect for files in the docs/ root was not working. I was aiming to redirect only when the file exists in /v1, but for now it will redirect any *.htm in root.
is correctly being redirected to v1. Why not KeyList?
I have no idea. After reviewing the redirect I had in place more closely, my new understanding is that it should not have worked at all, and I do not see how Hotkey.htm could have been redirected.

ThePeter
Posts: 49
Joined: 25 Oct 2022, 05:57

Re: Broken links from v1 to v2 docs & broken redirects

Post by ThePeter » 20 Dec 2022, 01:24

Does this behaviour offend you? Stating your opinion in absolutes like this is not helpful.
It does not offend me at all, and I do not think that I said that. I have stated my opinion in absolute because the redirecting behaviour in question seems so absurd to me that I did not consider it probable that it was the intended behaviour. Now that I see that that assumption was incorrect, I am happy to elaborate.

In the web, redirects are commonly used in order to bring the user to the page that they were heading to even in a situation when the link/url has changed or is otherwise inexistent but can be resolved to the page that was the intended target of the request. Of course, that behaviour is not prescribed by any law, but it is the behaviour that users are expecting based on decades of browsing experience.

Redirecting to Google means that a user is brought to a target that clearly was not the target of the user's request. This happens without the user receiving any kind of feedback or notification that a redirect has happened and why. It is counter-intuitive and confusing. In the worst case, what happens is what happened to me yesterday: You find yourself in Google, and clicking the first search result only brings you back to the same Google page. It took me a while yesterday understanding what was happening and why Google was apparently linking to itself.

I understand that the situation yesterday was probably a temporary phenomenon due to Google's search index not having been updated yet. Nevertheless, abusing redirects for sending the user to a site that they were not trying to go to, is prone to producing unexpected behaviour. It is not good practice.

The better solution would be providing the user with a 404 error page stating that the page does not exist, and on that page offer the user a link to go to Google with their request, if they so wish.

lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Broken links from v1 to v2 docs & broken redirects

Post by lexikos » 20 Dec 2022, 02:38

@ThePeter
This is not news to my present self, but I can only guess what I was thinking when I designed the redirect (and I'm not even certain that was me). The point of "regardless of what you or anyone else personally consider to be correct, or any other reasons for or against" was that my comment wasn't about ideal behaviour, but merely the one statement I quoted.

ThePeter
Posts: 49
Joined: 25 Oct 2022, 05:57

Re: Broken links from v1 to v2 docs & broken redirects

Post by ThePeter » 20 Dec 2022, 03:51

The point of "regardless of what you or anyone else personally consider to be correct, or any other reasons for or against" was that my comment wasn't about ideal behaviour, but merely the one statement I quoted.
Point taken. In future, I will try saying "I see no point" instead of "there is no point".

Post Reply

Return to “Suggestions on Documentation Improvements”