Advertisement
freephile

Move mediawiki directory with clean URLs

Sep 27th, 2016
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.   ## http://www.mediawiki.org/wiki/Manual:Short_URL/Apache
  4.   # Enable the rewrite engine
  5.   RewriteEngine On
  6.  
  7. ## Add initial rule for rewriting requests to the 'oldWiki' folder to the new virtual script path
  8. RewriteRule ^/?oldWiki/(index|api).php(.*)$ /wiki/$1 [QSA,PT]
  9.  
  10.  
  11.  
  12.   # Short url for wiki pages
  13.   RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
  14.   # Redirect / to Main Page
  15.   RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]
  16.  
  17.   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
  18.   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
  19.   RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B]
  20.  
  21.   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
  22.   RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
  23.   RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement