dlang.org endpoint for permanent links to DIPs

Jacob Carlborg doob at me.com
Fri Jun 5 06:53:13 UTC 2020


On 2020-06-03 15:25, Seb wrote:

> Yeah, I fully agree that DIP links breaking when their status changes is 
> a really big problem. I also wrote to Mike about this a while ago.
> 
> I guess the easiest/quickest option is to add redirects to dlang.org.
> This can be done by adding "Redirect 301 /dips/1028 
> https://github.com/.../"
> 
> https://github.com/dlang/dlang.org/blob/master/.htaccess
> 
> However, I think this will require quite a bit of manual maintenance and 
> is easy to forget, so the best option is to render the Markdown into 
> HTML automatically at the DIPs repository, which can then continuously 
> be deployed to e.g. dips.dlang.org

An alternative would be, for a URL like this:

https://dips.dlang.org/1234

Extract everything after the slash, "1234" in this case, and check a 
list of URLs to redirect to:

https://github.com/dlang/DIPs/blob/master/DIPs/archive/DIP1234.md
https://wiki.dlang.org/DIP1234
https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1234.md
https://github.com/dlang/DIPs/blob/master/DIPs/DIP1234.md
... and so on

Redirect to the first one that exists. I don't know if that's possible 
to do directly in Apache, or if an additonal server side process is 
required to handle this.

I remember we did something similar at work for server side caching of 
web pages. But that checked a local file instead of another URL. That 
was purely done inside Apache.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list