主域名定向到子目录

在public_html根目录建立文件.htaccess,加入以下内容:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?你的域名\.com$
RewriteCond %{REQUEST_URI} !^/子目录/
RewriteRule ^(.*)$ /子目录/$1

比如你想定向www.google.com到子目录下的文件夹index,那么就改成

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?google\.com$
RewriteCond %{REQUEST_URI} !^/index/
RewriteRule ^(.*)$ /index/$1

 

给MediaWiki 1.91.1安装CKEditor 3.6.4(原FCKEditor)

来源:http://www.mwusers.com/forums/showthread.php?16957-CKEditor-with-MediaWiki

在LocalSettings.php中添加:

require_once("$IP/extensions/ckeditor/ckeditor.php");
$wgHooks['EditPage::showEditForm:initial'][] = 'showEditForm'; 
function showEditForm($form)
{ 
    global $wgOut; 
    $wgOut->addScriptFile( '/extensions/ckeditor/ckeditor.js' ); 
    $script = "<script type="text/javascript"> window.onload = function() 
   { 
    CKEDITOR.replace( 'wpTextbox1' ); }; 
    if ( window.removeEventListener ) window.removeEventListener( 'load', mwSetupToolbar, false ) ; 
     else if ( window.detachEvent ) window.detachEvent( 'onload', mwSetupToolbar ) ; </script>"; 
$wgOut->addHTML($script); return true; 
}