Skip to content

Instantly share code, notes, and snippets.

@ShenXuGongZi
Created April 30, 2014 10:48
Show Gist options
  • Save ShenXuGongZi/fae11281445fac8408d0 to your computer and use it in GitHub Desktop.
Save ShenXuGongZi/fae11281445fac8408d0 to your computer and use it in GitHub Desktop.
Dokuwiki
RewriteEngine on
RewriteBase /dokuwiki
RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L]
RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L]
RewriteRule ^_export/([^/]+)/(.*) doku.php?do=export_$1&id=$2 [QSA,L]
RewriteRule ^$ doku.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) doku.php?id=$1 [QSA,L]
RewriteRule ^index.php$ doku.php
@ShenXuGongZi
Copy link
Author

location / { try_files $uri $uri/ @dokuwiki; }

location @dokuwiki {
    rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
    rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
    rewrite ^/_export/([^/]+)/(.*) /vpsbar.php?do=export_$1&id=$2 last;
    rewrite ^/(.*) /vpsbar.php?id=$1&$args last;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment