Skip to content

Instantly share code, notes, and snippets.

@abarth500
Last active August 29, 2015 14:26
Show Gist options
  • Save abarth500/7bb5c5d6dfe0c0873941 to your computer and use it in GitHub Desktop.
Save abarth500/7bb5c5d6dfe0c0873941 to your computer and use it in GitHub Desktop.
Mediawiki用 htaccess
#MediaWiki URL省略スタイル用htaccess
#extディレクトリは直接参照可能 (自作のPHPを置いたり等のため)
RewriteEngine on
RewriteRule ^/ext(.*)$ /ext$1 [L,QSA]
RewriteRule ^[^:]*\.(php|src|jpg|jpeg|png|gif|css|js|inc|swf|flv|phtml|pl|ico|html|shtml|zip|rar|svg|gz)$ - [L,NC]
RewriteRule ^index.php?title - [L]
RewriteRule ^(.*)\&(.*)$ /index.php?title=$1\%26$2 [L,QSA]
RewriteCond %{REQUEST_URI} (//+)
RewriteRule ^(.*)/(.*)$ /index.php?title=$1%1$2 [L,QSA]
RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]
RewriteRule ^/*$ /index.php?title=eting [L,QSA]
#最終行に追加
$wgArticlePath = "/$1";
#その他の設定
$wgAllowExternalImages = true;
$wgAllowDisplayTitle = true;
$wgRestrictDisplayTitle = false;
$wgCapitalLinks = false;
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg','cvs','gz','pdf','doc','docx','ppt','pptx');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment