Skip to content

includes.php: add trailing slashes to generated wiki links

Jaime Nuche requested to merge dir-redirects into master

Our wiki instances have an apache proxy running in front of them. By default, the following apache directive is enabled: https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryslash

This will cause a redirect for urls without a trailing slash that are accessing a directory. In the case of K3s envs, the apache proxy listens on port 8080 which in production will create a redirection url like e.g. 49b8d5c4b5.catalyst.wmcloud.org/w -> 49b8d5c4b5.catalyst.wmcloud.org:8080/w/.

This redirection will fail, as the call to catalyst.wmcloud.org will have to go again through the external cloud vps web proxy. This proxy listens on port 80 only.

Adding the trailing slash to the generated wiki urls avoids the redirection and solves the problem

Bug: T373078

Edited by Jaime Nuche

Merge request reports