From owner-freebsd-chat@FreeBSD.ORG Tue Feb 19 08:27:03 2013 Return-Path: Delivered-To: freebsd-chat@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3A310630; Tue, 19 Feb 2013 08:27:03 +0000 (UTC) (envelope-from cnst++@FreeBSD.org) Received: from Cns.Cns.SU (unknown [IPv6:2001:470:7240::]) by mx1.freebsd.org (Postfix) with ESMTP id B8ECA6B4; Tue, 19 Feb 2013 08:27:02 +0000 (UTC) Received: from Cns.Cns.SU (cnst@localhost [127.0.0.1]) by Cns.Cns.SU (8.14.5/8.14.5) with ESMTP id r1J8R17I007714; Tue, 19 Feb 2013 00:27:01 -0800 (PST) Received: (from cnst@localhost) by Cns.Cns.SU (8.14.5/8.14.5/Submit) id r1J8R1rs023311; Tue, 19 Feb 2013 00:27:01 -0800 (PST) X-Authentication-Warning: Cns.Cns.SU: cnst set sender to cnst++@FreeBSD.org using -f Date: Tue, 19 Feb 2013 00:27:01 -0800 From: "Constantine A. Murenin" To: freebsd-chat@FreeBSD.org, freebsd-current@FreeBSD.org, freebsd-doc@FreeBSD.org Subject: announcing mdoc.su, short manual page URLs Message-ID: <20130219082700.GA9938@Cns.Cns.SU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 08:27:03 -0000 Dear freebsd-{chat,current,doc}@, I would like to announce and introduce , a deterministic URL shortener for BSD manual pages, written entirely in nginx.conf. It supports several address schemes, for example: http://mdoc.su/f/zfs http://mdoc.su/f/zfs.8 http://mdoc.su/f/8/zfs http://mdoc.su/freebsd/zfs http://mdoc.su/FreeBSD/zfs http://mdoc.su/d/hammer.5 http://mdoc.su/d/hammer.8 etc. Source code for the whole mdoc.su.nginx.conf is available at: https://github.com/cnst/mdoc.su https://bitbucket.org/cnst/mdoc.su Specifically, the following currently controls FreeBSD rewriting: location /FreeBSD { rewrite ^/FreeBSD(/.*)?$ /f$1; } location /f { set $fb "http://www.freebsd.org/cgi/man.cgi?query="; set $fs "&sektion="; rewrite ^/freebsd(/.*)?$ /.$1; rewrite ^/./([^/.]+)/([^/]+)$ $fb$2$fs$1 redirect; rewrite ^/./([^/]+)\.([1-9])$ $fb$1$fs$2 redirect; rewrite ^/./([^/]+)$ $fb$1$fs redirect; rewrite ^/./?$ / last; return 404; } Translation: "/FreeBSD" and "/freebsd" get rewritten to "/f" internally, without any extra replies to the user, and then the rest of the URI is analysed, and a "302 Found" redirect is finally issued to the user. Pages like http://mdoc.su/f/ redirect to the main "/" page internally, without affecting the URL that's visible to the user, making it easier to keep a starting page specifically for one BSD. Questions, comments and suggestions are very welcome. Available through IPv4 and IPv6. Enjoy! Best regards, Constantine.