I am attempting to setup multiple dokuwiki's but I am really struggling...
I can set up one with relative ease but I would like to make use of the farm concept ( https://www.dokuwiki.org/farms ). The downside is it is written for apache not nginx and equally I have not found any nginx guides.
I am unable to make use of vhost where this shall be deployed (I have test vhost locally and I can configure this) and thus the nginx equivalent of htaccess is required.
The problem appears to be around the "animal" rewrite
RewriteRule ^/?([^/]+)/(.*) /farmer/$2?animal=$1 [QSA]
RewriteRule ^/?([^/]+)$ /farmer/?animal=$1 [QSA]
becomes (within a relevant location).
rewrite ^/?([^/]+)/(.*) /farmer/$2?animal=$1;
rewrite ^/?([^/]+)$ /farmer/?animal=$1;
NOne of what I have tried works so I decided to step right back and follow the redirect tips ( https://www.dokuwiki.org/tips:redirect_farm ) and I am unable to produce a functioning Step 2: Setup the URL binding the testing of the redirect
This is my localhost.conf.
server { listen 80; server_name localhost; access_log
/var/log/nginx/localhost_access_log main; error_log
/var/log/nginx/localhost_error_log info; rewrite_log on; root
/var/www/localhost/htdocs; #location ~
/(data/|conf/|bin/|inc/|install.php) { deny all; }
location / { autoindex on; }
location /barn { #alias /var/www/localhost/htdocs/farmer/;
rewrite ^/?([^/]+)/(.*) /farmer/$2?animal=$1; rewrite ^/?([^/]+)$ /farmer/?animal=$1; }
}
http://localhost/barn does redirect to "farmer" and the debug logs show:
*1 rewritten data: "/farmer/", args: "animal=barn", client: 127.0.0.1, server: localhost, request: "GET /barn/ HTTP/1.1", host: "localhost"
the animal=barn part is the worry... equally http://localhost/barn/foo fails with 404 and the rewrite logs show:
rewritten data: "/farmer/foo", args: "animal=barn", client: 127.0.0.1, server: localhost, request: "GET /barn/foo HTTP/1.1", host: "localhost"
what I was expecting was animal=foo. Any advice as to how to correct the rewrite