Feature request : Short URL redirection

Discuss issues and requests related with the forum software
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Feature request : Short URL redirection

08 Aug 2021, 08:55

For example, following url's should redirect to this topic/post.

ahkscript.org/t93512
ahkscript.org/p414331

Can something like this be done?.
I want to stop using external providers.
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Feature request : Short URL redirection

08 Aug 2021, 12:05

Simple enough! I only implemented "p" which takes the "t=#####" numbers. :thumbup:
http://ahkscript.org/?p=93512
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: Feature request : Short URL redirection

08 Aug 2021, 12:27

joedf wrote:
08 Aug 2021, 12:05
Simple enough! I only implemented "p" which takes the "t=#####" numbers. :thumbup:
http://ahkscript.org/?p=93512
Thank you very much @joedf :thumbup:

t= isn't possible? In case you want to support direct post link in future?
For example, user @teadrinker (almost) always post scripts as solutions in ask-for-help.
A direct link to a post is too long like:
https://www.autohotkey.com/boards/viewtopic.php?p=414331#p414331
Just suggesting.

Thanks again. :)
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Feature request : Short URL redirection

08 Aug 2021, 17:07

Oops, my bad! For some reason I though was t for direct posts... :mrgreen: I have implement all three :thumbup: , so this:
http://ahkscript.org/?f=3&t=93512&p=414348
is equivalent to this:
https://www.autohotkey.com/boards/viewtopic.php?f=3&t=93512&p=414348#p414348

so it should be sufficient to just do this for specific posts:
http://ahkscript.org/?p=414348

For reference, php code:
Spoiler
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
neogna2
Posts: 600
Joined: 15 Sep 2016, 15:44

Re: Feature request : Short URL redirection

10 Aug 2021, 07:09

joedf wrote:
08 Aug 2021, 17:07
http://ahkscript.org/?p=414348
I first get a browser warning (because not https) and then it loads forever without resolving to the forum URL.
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: Feature request : Short URL redirection

10 Aug 2021, 08:23

neogna2 wrote:
10 Aug 2021, 07:09
I first get a browser warning (because not https) and then it loads forever without resolving to the forum URL.
Thanks for reporting. It was working perfectly when @joedf implemented it.
 
@tank might have changed something recently.
@tank : Please look into this.
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Feature request : Short URL redirection

10 Aug 2021, 09:00

Server worked was being done yesterday. I don't know what specifically, but mainly the ahkscript.org domain is not working as before. :think:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: Feature request : Short URL redirection

10 Aug 2021, 09:12

joedf wrote:
10 Aug 2021, 09:00
the ahkscript.org domain is not working as before.
Oh! :o
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Feature request : Short URL redirection

10 Aug 2021, 09:40

As far as I can tell we still own the domain, but I dont have access to it so I am not sure... :think:
Anyway, I suspect this is only temporary. In the mean time, i've added this feature on the autohotkey.com domain :+1:
https://autohotkey.com/r?p=414348
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: Feature request : Short URL redirection

10 Aug 2021, 09:54

joedf wrote:
10 Aug 2021, 09:40
As far as I can't tell we still own the domain, but I dont have access to it so I am not sure... :think:
That statement is confusing. Can? or Can't?.
 
joedf wrote:
10 Aug 2021, 09:40
https://autohotkey.com/r?p=414348
Yay! :dance:
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Feature request : Short URL redirection

10 Aug 2021, 10:11

Whoops.. "can"... edited my post :mrgreen: thanks
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
neogna2
Posts: 600
Joined: 15 Sep 2016, 15:44

Re: Feature request : Short URL redirection

12 Aug 2021, 11:49

joedf wrote:
10 Aug 2021, 09:40
https://autohotkey.com/r?p=414348
Working now :thumbup:

Code: Select all

; v1.1
;Long  URL format https://www.autohotkey.com/boards/viewtopic.php?p=414597#p414597
;Short URL format https://www.autohotkey.com/r?p=414597
AhkForumUrlShorten(URL) {
    if RegExMatch(URL, "^https\:\/\/www.autohotkey\.com\/boards\/viewtopic\.php\?.*(p=\d+).*$", Match)
        return Match1 ? "https://www.autohotkey.com/r?" Match1 : ""
}

Code: Select all

; v2.0-beta.1
;Long  URL format https://www.autohotkey.com/boards/viewtopic.php?p=414597#p414597
;Short URL format https://www.autohotkey.com/r?p=414597
AhkForumUrlShorten(URL) {
    if RegExMatch(URL, "^https\:\/\/www.autohotkey\.com\/boards\/viewtopic\.php\?.*(p=\d+).*$", &Match)
        return Match[1] ? "https://www.autohotkey.com/r?" Match[1] : ""
}
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Feature request : Short URL redirection

03 Sep 2021, 18:23

it seems that the default index.php, index.html, index.htm has been changed...
Additionally, it seems that @mentions are gone too...
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
SKAN
Posts: 1551
Joined: 29 Sep 2013, 16:58

Re: Feature request : Short URL redirection

04 Sep 2021, 03:34

joedf wrote:
03 Sep 2021, 18:23
it seems that the default index.php, index.html, index.htm has been changed...
Additionally, it seems that @mentions are gone too...
Can this be fixed @joedf?
PS: I wrapped your nick with [mention] manually.
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Feature request : Short URL redirection

07 Sep 2021, 13:13

@SKAN Should be fixed now! :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “Forum Issues”

Who is online

Users browsing this forum: No registered users and 32 guests