On 08/10/2022 02:50, Tim Landscheidt wrote:
Bastien Guerry <b...@gnu.org> wrote:

https://git.sr.ht/~bzg/worg/tree/master/item/nginx.conf

Thanks.  Assuming the relevant line is:

|     rewrite HTML-export.html HTML-Export.html permanent;

looking at
http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite
suggests that this will match any URL that contains the
string "HTML-export.html", i. e. the regular expression is
not anchored anywhere.

So if that regular expression is intended to match on URLs
that end in "/HTML-export.html", an (untested) fix would be
something along the lines of:

|     rewrite /HTML-export\.html$ HTML-Export.html permanent;

Bastien, I have not tried full configuration, but after a quick check I believe that it is a reasonable suggestion. It prevents 301 redirection from valid URLs like
https://orgmode.org/manual/Links-in-HTML-export.html
to
https://orgmode.org/manual/HTML-Export.html

In addition I would consider

    location /manual/ {
    }

around the rewrite directives to prevent unintentional false positives in e.g. worg.

P.S. Workarounds:
M-: (info "(org) Links in HTML Export")
https://orgmode.org/org.html#HTML-Export


Reply via email to