Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

ahk4.me - short urls/e-mail/data-API for AutoHotkey users


  • Please log in to reply
118 replies to this topic
daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005

ATTENTION! THE API KEY WAS CHANGED, DUE TO ABUSE (SEE BELOW)

ADAPT YOUR SOFTWARE/SCRIPTS/SITES

* ahk4.me - AutoHotkey dedicated domain

What is it?

The ahk4.me domain was registered to provide a "portal"/api site for getting/sending data that might be useful for AutoHotkey scripting. This was intended for personal use at first, but has now been made public for anybody to use.

How can you offer this and what exactly do we get?

I can offer you this, because the webhoster I use has the following features:
[*:27upak34]Very cheap. Costs are calculated based on average stored data size (including files and MySQL databases, excluding e-mail accounts), therefore, as long as the data-amount stays limited, total costs of use are minimal.[*:27upak34]Unlimited bandwith[*:27upak34]Unlimited 1 GB e-mail addresses with Webaccess and POP3/SMTP/IMAP access options, including over secured connections[*:27upak34]Unlimited MySQL databases with system-wide PhpMyAdmin access[*:27upak34]Unlimited FTP accounts (for developer/test access)[*:27upak34]PHP4/PHP5, PEAR extensions installed or installable, IonCUBE/ZendGuard pre-installed[*:27upak34]Perl, Python, Ruby, Tcl. Extensions installed or installable[*:27upak34]mod_rewrite[*:27upak34]SSL-Proxy via wildcard domain. Custom https domains in the form somestring-secured-by.xlhost.de/[*:27upak34]Pre-pay system. The funds needed to keep this site running are already available for the future. Continuity is therefore guaranteed.[*:27upak34]Based in Germany. Strong privacy laws and "central" internet location[*:27upak34]Excellent support. Very receptive to requests.So, as long as we can avoid creating many/big files or MySQL databases, this will stay cheap, and since the package contains almost anything considered necessary for web-development, almost anything could be used/created.

What are you never going to do?
[*:27upak34]Charge anything for use. This site is free and will remain free[*:27upak34]Close the source. The code will always be available[*:27upak34]Let the domain willingly expire. When sufficient funds seem to be running out, I might ask for a fund-raiser to keep it running, but if my hosting provider stays as cheap as it currently is, I do not think this ever will be necessary. Currently there is plenty funds already on the pre-pay account to keep the site running for many years[*:27upak34]Willingly delete links, let them expire or remove introduced optionsWhat can I do with it so far then?
[*:27upak34]"Get a custom ahk4.me e-mail address". Send and receive e-mails from/to your own ahk4.me e-mail address (registered users)[*:27upak34]"Shorten any". Shorten any AutoHotkey related link to something like ahk4.me/Zb8eF[*:27upak34]"Shorten docs". Create shortened/shorthand links to the AutoHotkey documentation like d.ahk4.me/MsgBox[*:27upak34]"IP". Get your current external IP[*:27upak34]"Geolocation". Get geolocation data from your/any IPWhat are you currently working on to add?
[*:27upak34]"Shorten pretty". Create easy to remember shortcuts for any AutoHotkey forum thread in the following form: f.ahk4.me/GDIp (registered users)What options are you planning on creating/adding?
[*:27upak34]"DNS". Do a DNS query (domain2ip, nameservers)[*:27upak34]"WHOIS". Do a WHOIS query for any domain/ip[*:27upak34]"PING". Do an online-check/PING query to any domain/ip[*:27upak34]Centralized user/access database for all "registered users" options[*:27upak34]"Remote". Remotely wake/access your computer from anywhere (registered users)[*:27upak34]Create a demo script/app to demonstrate all options of ahk4.meWhat options do you consider adding?
[*:27upak34]Windows constants[*:27upak34]Windows API[*:27upak34]Syntax files[*:27upak34]Process info[*:27upak34]Virus check[*:27upak34]File/process updater[*:27upak34]Encrypt[*:27upak34]CRC/checksum[*:27upak34](Small) document converter[*:27upak34]Proxy for autohotkey.com/autohotkey.net only[*:27upak34]Userspace on autohotkey.net redirect (thanks polyethene)[*:27upak34]Pastebin (thanks polyethene)What if I thought of/found/coded something that might be good to add?
[*:27upak34]Post it as clear as possible in this thread, or contact me. If needed, I can provide all necessary access to a test account/subdomain on my server and anything else needed, like MySQL databases (remember to keep data-size as small as possible, and preferably look for external data-sources/APIs).What options are you never going to add, so I do not even need to request?
[*:27upak34]Anything that would be data-intensive, by needing many/big files, either permanent or temporary, or big MySQL databases (see: How can you offer this?)[*:27upak34]Anything that is completely unrelated to AutoHotkey or use with an AutoHotkey script[*:27upak34]Anything illegal[*:27upak34]Proxy scripts/options (high illegallity risk)[*:27upak34]Big video/audio/image/data conversion/download/upload scripts/options (too data-intensive, high illegality risk)How can I help?
[*:27upak34]Use it, try it, ask questions, post remarks[*:27upak34]Get the source code, and improve/tweak/add to it[*:27upak34]Create/find new, additional options and post them (remember to keep data-size as small as possible, and preferably look for external data-sources/APIs)[*:27upak34]Sign up as a new customer at xlhost.de using my referral link, this will add a small amount to the balance. History:
[*:27upak34]2011-11-17 + Changed: Complete rewrite of first posting in thread[*:27upak34]2011-11-10 + Added: Beta of "Shorten pretty" by Frankie[*:27upak34]2011-09-10 + Added: Bitbucket and Subversion repositories[*:27upak34]2011-09-09 + Added: GitHub repository and direct source download[*:27upak34]2011-08-22 + Added: "IP" and "Geolocation"[*:27upak34]2011-08-21 + Added: "Shorten any"-form by Frankie[*:27upak34]2011-08-17 + Added: "Shorten any" and "Shorten to docs"[*:27upak34]2011-08-17 + Added: First version published based on a request in the Chat-forumStatistics:
[*:27upak34]2011-11-17 - Est. average monthly data in use: 250 kB. Est. monthly bandwith: 200 MB. E-mail addresses in use: 6/unlim.Billing/balance:
[*:27upak34]2011-11-17 - Current balance: + 38.79 Euro (~ 50 $). Current montly est. costs: 0,30 Euro (~ 0.40 $)[*:27upak34]2011-08-15 - Registered domain ahk4.me for 20 Euro (renewal pending on 2013-08-15, est. price 20 Euro for an extra year, based on current pricing)Acknowledgements:
[*:27upak34]xlhost.de for being such a great yet cheap hosting company[*:27upak34]Chris/Lexikos and anybody who is/was working to create AutoHotkey in the past, now and in the future[*:27upak34]Frankie for suggesting this in the first place and his help with the form/PHP coding[*:27upak34]nimda for all his suggestions and help[*:27upak34]polyethene for simultaneously doing similar things and of course for autohotkey.net[*:27upak34]Anybody else who posted questions/remarks or helped in any other way[*:27upak34]All open-source code/free API sites that are used to make it all possible


* Get a custom ahk4.me e-mail address

You can request a custom e-mail address in the form: <!-- e --><a href="mailto:autohotkeyforumusername@ahk4.me">autohotkeyforumusername@ahk4.me</a><!-- e -->.

Prerequisites:
[*:27upak34]Long-time user with a history of regular posting on the AutoHotkey forum.[*:27upak34]An existing and working contact e-mail address to contact you for issues.[*:27upak34]Only e-mail addresses that correspond exactly with your AutoHotkey user name will be granted.[*:27upak34]Only 1 e-mail address per person will be granted.[*:27upak34]Requests must be done via PM, so I can be sure you are who you are. Requests per e-mail will not be granted.You can:
[*:27upak34]Only use it for AutoHotkey related issues.[*:27upak34]Fill your e-mail box with up to 1 GB of data max (should suffice).[*:27upak34]Access your e-mail from anywhere using the Webinterface.[*:27upak34]Access your e-mail with any e-mail client. POP3/SMTP/IMAP is all supported, including secure connections.[*:27upak34]Set it up to forward all e-mails to another e-mail address, or do other advanced filtering according to rules you create.[*:27upak34]Add an image of your e-mail address to use for your AutoHotkey forum signature (see my signature below) or anywhere else. This image will be generated for you at account creation at http://i.ahk4.me/e/s...fcharacters.png.You cannot:
[*:27upak34]Use it for non-AutoHotkey related issues.[*:27upak34]Post the e-mailaddress in plain text anywhere on the public internet (to prevent spam-bot harvesting).[*:27upak34]Use it to send spam, threaten or harrass or do anything else considered illegal or rude.Remarks:
[*:27upak34]The e-mail address can be closed by me anytime, if I feel there is a reason to. You would get the chance to download/backup your data first.[*:27upak34]I will never access your e-mail data, unless there is a dispute somehow (see: You cannot).
PM me to request your custom ahk4.me e-mail address.

Wishlist:
[*:27upak34]noneToDo:
[*:27upak34]noneHistory:
[*:27upak34]2011-08-17 - + Added: First version


* URL-shortening of any AutoHotkey related link

You can use the ahk4.me domain for url shortening of autohotkey.com or autohotkey.net links or other, AutoHotkey related links.

The backend is provided by bit.ly. All generated links are compatible with bit.ly, meaning, you can change ahk4.me/XyZ127 into bit.ly/XyZ127 and it should still work.

Here is the API documentation at bit.ly (you probably won't need it, take a look at the options below).

This is the public timeline of the account: https://bitly.com/u/ahk4me, where you can have a look at the generated shortened urls.

This is the data you'll need:

Login: ahk4me
API key: R_4b3df1f5417d94ff356ed511fd50a153 (deleted due to abuse), new key: R_49eca3c0f2340588f40efcfebcaacb01

PLEASE USE ONLY TO SHORTEN LINKS TO PAGES AT AUTOHOTKEY.COM, AUTOHOTKEY.NET OR OTHERWISE RELATED TO AUTOHOTKEY!!!

IF ABUSED I WILL GENERATE A NEW API KEY, MAKE IT PRIVATE AND ONLY GIVE IT TO SPECIFIC USERS.


I won't share the password of the account (out of obvious reasons), so you'll need to use the API, self-made forms or bookmarklets won't work.

1. AutoHotkey Basic

Thanks to Voltron43, you can use the [Library] bit.ly API (shortened: http://ahk4.me/oOpIXF) to shorten/expand links.

#Include %A_ScriptDir%\bitlyAPI.ahk

login := "ahk4me"
apiKey := "R_4b3df1f5417d94ff356ed511fd50a153"

val := bitly_shorten("http://www.autohotkey.com/forum/",1)
MsgBox, % val
Result: <!-- m -->http://ahk4.me/pYLmmz<!-- m -->

2. AutoHotkey Basic or AutoHotkey_L+

Use the script by nimda/sinkfaze (compatible with AHK_L):
rep :=   "&|%26,=|%3D,?|%3F,#|%23,:|%3A,/|%2F, |%20"

#^b::
 Loop Parse, rep, `,
    StringReplace, clipboard, clipboard, % SubStr(A_LoopField, 1, 1), % SubStr(A_LoopField, 3), All
 UrlDownloadToFile
  ,http://api.bitly.com/v3/shorten?login=ahk4me&apiKey=R_4b3df1f5417d94ff356ed511fd50a153&longUrl=%clipboard%&format=txt
  , % fn :=   A_Temp "\BitlyAHK4ME.tmp"
 Fileread, Url, %   fn
 Clipboard :=   RegExReplace(Url, "\R")
return
3. Online form

You can also use the form (created by Frankie) at shorten.ahk4.me


Wishlist:
[*:27upak34]noneToDo:
[*:27upak34]noneHistory:
[*:27upak34]2011-08-21 + Added: "Shorten any"-form by Frankie[*:27upak34]2011-08-17 + Added: First versionAcknowledgements:
[*:27upak34]bit.ly for their option to use another domain with their service, all free[*:27upak34]Voltron43 for the AutoHotkey Basic bit.ly script/library[*:27upak34]Frankie for the form, script snippets and other help and for being the firestarter of it all[*:27upak34]nimda for the script snippets and other help[*:27upak34]sinkfaze for the script snippets and other help


* Short links to the AutoHotkey documentation

Create shortened/shorthand links to the AutoHotkey documentation. You can use urls in the following form to link to the documentation:

http://docs.ahk4.me/Hotstrings (documentation page)
http://docs.ahk4.me/~DllCall (command)

or, even shorter:

http://d.ahk4.me/FAQ (documentation page)
http://d.ahk4.me/~MsgBox (command)

You can also use the following format to redirect to an anchor on a documentation page:

http://d.ahk4.me/Variables#Expressions

NB!: not all links work yet.

Wishlist:
[*:27upak34]noneToDo:
[*:27upak34]Make compatible with all possible documentation linksHistory:
[*:27upak34]2011-08-17 + Added: First versionAcknowledgements:
[*:27upak34]Frankie for help with coding[*:27upak34]nimda for the idea and other help


* Get your external IP address

Goto http://ip.ahk4.me/

It will return your external ip.

Wishlist:
[*:27upak34]noneToDo:
[*:27upak34]Add options for xml/json/other outputHistory:
[*:27upak34]2011-08-17 + Added: First version


* Get geolocation data from IP

It will return geolocation data for your (or another) IP.

Goto http://geo.ahk4.me/

You can use it directly, then it will return your own geolocation data, or you can add another IP in the following form:

Other IP: http://geo.ahk4.me/?ip=123.123.123.123

Result: OK;;123.123.123.123;CN;CHINA;BEIJING;BEIJING;-;39.9;116.413;+08:00

The backend is provided by ipinfodb.com

Wishlist:
[*:27upak34]noneToDo:
[*:27upak34]Add options for xml/json/other output[*:27upak34]Add acknowledgements to outputHistory:
[*:27upak34]2011-08-17 + Added: First versionAcknowledgements:
[*:27upak34]ipinfodb.com for their API


* URL-shortening with a "pretty" link to any AutoHotkey forum post (BETA)

Goto http://test.ahk4.me/new

PM Frankie for the secret code.

Code/functionality will be moved to f.ahk4.me when ready. This option will be available for registered users only.

Wishlist:
[*:27upak34]noneToDo:
[*:27upak34]test[*:27upak34]possible rewrite[*:27upak34]add user/access database[*:27upak34]create auth. API accessHistory:
[*:27upak34]2011-11-10 + Added: First beta versionAcknowledgements:
[*:27upak34]Frankie for the code


* Download, versioning/help with coding

You can pull the source from:

- GitHub (git)
- Bitbucket (mercurial)
- Sourceforge (subversion)

Or download a .zip-file with the source from:

- ahk4.me
- Sourceforge

Wishlist:

[*:27upak34]noneToDo:
[*:27upak34]noneHistory:
[*:27upak34]2011-09-10 + Added: Bitbucket and Subversion repositories[*:27upak34]2011-09-09 + Added: GitHub repository and direct source downloadAcknowledgements:
[*:27upak34]GitHub, Bitbucket and Sourceforge for their file hosting/versioning


8)

nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010

2:

You can now use urls in the following form to link to the documentation

http://docs.aboutscript.com/Hotstrings (documentation page)
http://docs.aboutscr.../strong>DllCall (command)

I'd say change that to

You can now use urls in the following form to link to the documentation

http://docs.ahk4.me/Hotstrings (documentation page)
http://docs.ahk4.me/.../strong>DllCall (command)

:?:
And I assume it would only be a few more lines in the .htacess to make that d.ahk4.me/ ? Please? :)

daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005
@nimda:

Thanks for spotting that, changed.

I'll add a d.ahk4.me option (extra), thanks for the idea.

nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010
Here is a small script which is Unicode-compatible and uses a hotkey to ahk4.me shorten the text on the clipboard.
rep := "&=?#:/"

#^b::
 Loop Parse, rep
    StringReplace, clip, clipboard, % A_LoopField, % StrHex(A_LoopField), All
 UrlDownloadToFile
   ,http://api.bitly.com/v3/shorten?login=ahk4me&apiKey=R_4b3df1f5417d94ff356ed511fd50a153&longUrl=%clip%&format=txt
   , % fn := A_Temp "\BitlyAHK4ME.tmp"
 Fileread, Url, % fn
 Clipboard := RegExReplace(Url, "\R")
return

StrHex(char){
   f := A_FormatInteger
   SetFormat, integer, hex
   r := SubStr(Asc(char), 3)
   StringUpper, r, r
   SetFormat, integer, %f%
   return "`%" . r
}
Written from scratch, here on the spot inside the post-a-reply box, without looking at anyone else's code. Tested on a single forum URL. Licensed under the WTFPL (linked under 'License' in my sig) without warranty.

Edit: removed newlines from output

daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005
Great! 8)

Now we could add a check for autohotkey.com or autohotkey.net in the link, to make sure it is from the wanted domains.

nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010

Great! 8)

Now we could add a check for autohotkey.com or autohotkey.net in the link, to make sure it is from the wanted domains.

I don't think anyone competent enough to run an AutoHotkey script and use its hotkeys will be deterred by an if statement :?:

Edit: I often use the # links in autohotkey docs, such as <!-- w -->www.autohotkey.com/docs/Variables.htm#Expressions<!-- w -->
Could the .htaccess file be changed like so?
[color=red]RedirectMatch /~(.*)#(.*)[/color] http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/commands/$1.htm[color=red]#$2[/color]
[color=red]RedirectMatch /(.*)#(.*)[/color] http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/$1.htm[color=red]#$2[/color]

RedirectMatch /~(.*).htm http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/commands/$1.htm
RedirectMatch /~(.*) http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/commands/$1.htm

RedirectMatch /(.*).htm http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/$1.htm
RedirectMatch /(.*) http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/$1.htm


sinkfaze
  • Moderators
  • 6365 posts
  • Last active:
  • Joined: 18 Mar 2008
The function seems like excessive overhead for encoding a very limited set of characters, wouldn't this suffice?

[color=red]rep :=	"&|%26,=|%3D,?|%3F,#|%23,:|%3A,/|%2F"[/color]

#^b:: 
Loop Parse, rep, `,
{
[color=red]	StringSplit, char, A_LoopField, | 
	StringReplace, clipboard, clipboard, %char1%, %char2%, All[/color]
} 
UrlDownloadToFile 
 ,http://api.bitly.com/v3/shorten?login=ahk4me&apiKey=R_4b3df1f5417d94ff356ed511fd50a153&longUrl=%[color=red]clipboard[/color]%&format=txt 
 , % fn :=	A_Temp "\BitlyAHK4ME.tmp" 
Fileread, Url, %	fn 
Clipboard :=	RegExReplace(Url, "\R") 
return


nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010
Where should <!-- m -->http://ahk4.me<!-- m --> go? it currently just goes to bit.ly :?:
I think it would be more appropriate for either
[*:2oxfjs6l]A redirect to <!-- w -->www.autohotkey.com<!-- w -->
[*:2oxfjs6l]An index.html which states that it is a Url-Shortening service for AutoHotkey.com and AutoHotkey.net (with a link to a shortening script?)
[*:2oxfjs6l]a redirect to <!-- w -->www.autohotkey.net<!-- w -->
@sinkfaze yes, but let me golf it hold on :lol:

nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010
Golfed :)
rep :=   "&|%26,=|%3D,?|%3F,#|%23,:|%3A,/|%2F, |%20"

#^b:: 
 Loop Parse, rep, `,
    StringReplace, clipboard, clipboard, % SubStr(A_LoopField, 1, 1), % SubStr(A_LoopField, 3), All
 UrlDownloadToFile 
  ,http://api.bitly.com/v3/shorten?login=ahk4me&apiKey=R_4b3df1f5417d94ff356ed511fd50a153&longUrl=%clipboard%&format=txt 
  , % fn :=   A_Temp "\BitlyAHK4ME.tmp" 
 Fileread, Url, %   fn 
 Clipboard :=   RegExReplace(Url, "\R") 
return


daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005

I don't think anyone competent enough to run an AutoHotkey script and use its hotkeys will be deterred by an if statement


Sure. :p

Could the .htaccess file be changed like so?


Done.

http://d.ahk4.me/Variables#Expressions works now.

The function seems like excessive overhead for encoding a very limited set of characters, wouldn't this suffice?


I'm not sure, will have to test. It might be that links on autohotkey.net use different characters though.

Where should <!-- m -->http://ahk4.me<!-- m --> go? it currently just goes to bit.ly


The DNS redirect is hardcoded. I don't think it is possible to make it redirect to anything else.

nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010

The function seems like excessive overhead for encoding a very limited set of characters, wouldn't this suffice?


I'm not sure, will have to test. It might be that links on autohotkey.net use different characters though.

http://ahk4.me/r7JQeu Works fine :D
and 3 lines shorter than sinkfaze's, which was several lines shorter than mine.


Done.

<!-- m -->http://d.ahk4.me/Variables#Expressions<!-- m --> works now.

I love it! :D

Frankie
  • Members
  • 2930 posts
  • Last active:
  • Joined: 02 Nov 2008

• An index.html which states that it is a Url-Shortening service for AutoHotkey.com and AutoHotkey.net (with a link to a shortening script?)

If you guys can figure out a way for that to work with just a plain HTML page, I can make a page for it that allows shortening from the site. No need to download anything.

The easier way would be a sub-domain with the page on it, but that's not ideal.

nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010
I think the only way to do this would be to have the bit.ly redirect on a subdomain like <!-- m -->http://b.ahk4.me/fdFHIW<!-- m --> but then we lose 2 characters... and I don't even know if that's allowed :roll:

Edit: @daonlyfreez, perhaps the newest shortener by sinkfaze and I should be in the first post? It could easily be lost in this discussion.

daonlyfreez
  • Members
  • 995 posts
  • Last active: Jan 23 2013 08:16 AM
  • Joined: 16 Mar 2005
This is my current .htaccess file. I tried adding "exceptions" for commands that start with a #, but I cannot get it to work. I'm not sure if the order of rules matters.

RedirectMatch /~(.*) <!-- m -->http://www.autohotke... ... nds/$1.htm<!-- m -->
RedirectMatch /~(.*)\.htm <!-- m -->http://www.autohotke... ... nds/$1.htm<!-- m -->
RedirectMatch /~#If <!-- m -->http://www.autohotke... ... Active.htm<!-- m -->
RedirectMatch /~#(.*) <!-- m -->http://www.autohotke... ... ds/_$1.htm<!-- m -->
RedirectMatch /~#(.*)\.htm <!-- m -->http://www.autohotke... ... ds/_$1.htm<!-- m -->
RedirectMatch /(.*) <!-- m -->http://www.autohotke... ... ocs/$1.htm<!-- m -->
RedirectMatch /(.*)\.htm <!-- m -->http://www.autohotke... ... ocs/$1.htm<!-- m -->
RedirectMatch /(.*)#(.*) <!-- m -->http://www.autohotke... ... /$1.htm#$2<!-- m -->


Now <!-- m -->http://www.autohotke...t/~Lexikos/Auto ... string.htm<!-- m -->, and I don't grasp why it does that...

:?

nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010
I hope you realize there is a #If command now?
Anyways, try this:
RedirectMatch /~#(.*) http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/commands/_$1.htm

RedirectMatch /~(.+)#(.+) http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/commands/$1.htm#$2
RedirectMatch /(.+)#(.+) http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/$1.htm#$2

RedirectMatch /~(.*).htm http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/commands/$1.htm
RedirectMatch /~(.*) http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/commands/$1.htm

RedirectMatch /(.*).htm http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/$1.htm
RedirectMatch /(.*) http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/$1.htm