New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request(http-redirected): Allowed redirects #789
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1. Summary
It would be nice if linkchecker users could specify allowed redirects that linkchecker wouldn’t return as warning.
2. Example of desired behavior
For example, Reddit add
\?rdt=\d{5}
to the end of each link, when I make any linkchecker request to the Reddit site. I get a warning like this:Reddit
URL
can be represented as a regular expression:Reddit
REAL URL
regular expression:where
$1
— matches from RedditURL
.We can add to
linkcheckerrc
the option likeallowed-redirects
:If the redirected
REAL URL
matches the expression^$1\?rdt=\d{5}$
, Linkchecker will not return a warning as in this case:But if the redirected
REAL URL
doesn’t match the regular expression^$1\?rdt=\d{5}$
, as in the next case, Linkchecker will return a warning:3. More examples of desired behavior
3.1. VK
No warning:
Warning:
3.2. Stack Overflow
No warning:
Warning:
3.3. TOML
No warning:
Warning:
4. Reasons why the feature is needed
In some cases, linkchecker users may find that it’s better not use redirected links. For my cases:
?rdt=37228
. I just want to add links to Reddit to my site and don’t worry that every time I have to add something to them.https://m.vk.com
. I think that it’s better to leave a link to the desktop version of the site by default. VK automatically redirect users of mobile devices to the mobile version of the site from desktop version, but not automatically redirect users of desktop devices to the desktop version of the site from mobile version.https://ru.stackoverflow.com/a/544861/199934
because in this format they remain unchanged if the title of a Stack Overflow question changes. Stack Overflow editors may change question titles quite often, and redirected links may become non-valid.https://toml.io/en/latest
. When the next version of TOML (2.0.0
,1.2.0
or1.0.1
) is released, the reference to version1.0.0
will no longer be a reference to the latest version.5. Not best ideas
5.1. Just use “ignorewarnings=http-redirected”
I think this is a very bad idea. If external site no longer works and its links lead to a spam site or to content that is different from the content that was there when the linkchecker user inserted the link,
http-redirected
carries important information to linkchecker users. In my case, throughhttp-redirected
I fixed about a hundred of outdated links on my site.5.2. Just add your URL to “ignore=”
I don’t think that ignoring is the best idea. If I add the URL to the ignore list, I will no longer receive any errors and warnings about that URL. I won’t be aware of any problems with this URL.
Thanks.
The text was updated successfully, but these errors were encountered: