org-protocol.el: URL rewrites
Sebastian Rose writes:
> * This is how it works:
>
> Each project in `org-protocol-project-alist' may now have a new
> element `:rewrites'. `:rewrites' is a list of cons cells, that maps
> regular expressions to relative paths.
>
>
>
> * Example:
>
> (setq org-protocol-project-alist
> '(("http://fairposter.de/"
> :base-url "http://example-web-shop.de/"
> :working-directory "/path/to/working/directory/"
> :online-suffix ".php"
> :working-suffix ".php"
> :rewrites (("example-web-shop.de/cars/" . "products.php")
> ("example-web-shop.de/$" . "index.php")
> ))
>
> ;; .... more projects here
> ))
>
>
> Today, if I visit http://www.example-web-shop.de/, the URL would
> not match a path to any of the files below my working directory.
>
> Tomorrow, /path/to/working/directory/index.php is opened, because there's
> a matching rewrite.
>
>
> Today, a rewritten URL like
> http://example-web-shop.de/cars/lamborghini/Gallardo_LP560-4_MY09
> would not match a path to any of the files below my working
> directory, because URLS like `..../cars/' would be rewritten on the
> server and served through http://example-web-shop.de/products.php.
>
> Tomorrow, that URL will be mapped to
> /path/to/working/directory/products.php, because there's a matching
> rewrite defined.