0

Short URL Rewriting for a MediaWiki installation?

Sεяεηδι ριτ fa 4 anys 0

Hi !


Based on this manual Manual:Short URL/wiki/Page title -- nginx rewrite--root access
https://www.mediawiki.org/wiki/Manual:Short_URL/wiki/Page_title_--_nginx_rewrite--root_access


I was wondering if you could help to configure Short URLs for MediaWiki at root directory of a Website in Ajenti.


Environment scenario:

  • MediaWiki has been installed in /srv/website_name/ directory
  • wiki is to be served from website_name.example.com
  • we want urls formated as /wiki/Page_Title

I've tried this kind of conf but no success :


 server {   listen 80;
   server_name website_name.example.com;

   root /srv/website_name;

   location / {
     index index.php;
     error_page 404 = @mediawiki;
   }

   location @mediawiki {
     rewrite ^/wiki([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last;
   }

   location ~ \.php?$ {
     include /etc/nginx/fastcgi_params;
     fastcgi_pass  127.0.0.1:8888;
     fastcgi_index index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
   }
 }

I've seen you helped someone with extension less URL here, and tried to merge this specific URL rewriting with the solution given but didn't succeded to anything.


Any help would be very nice :)


Thanks