我有一個在其根目錄下有WordPress安裝的子域(例如https://sub.domain.com
)。這會打開WordPress的首頁。如何在同一子域上啓用WordPress安裝和Mediawiki安裝?
然後我安裝在一個名爲w
目錄Mediawiki的安裝和使用方法SHORTURL specified here in this Mediawiki documentation更名並添加了必要的.htaccess
調整,使MediaWiki的安裝使用此URL結構:https://sub.domain.com/wiki
。
然後,我在另一個名爲typ
的文件夾中添加了另一個Mediawiki安裝,並遵循上述相同的步驟。
我想爲不同的目的安裝2個Mediawiki。他們不相互關聯。
但是,在Mediawiki安裝之後,WordPress接手了,當我嘗試訪問/wiki
網址時,我從WordPress獲得404 not found
。
這裏是我的.htaccess
代碼:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/?typing(/.*)?$ %{DOCUMENT_ROOT}/typ/index.php [L]
RewriteRule ^/?$ %{DOCUMENT_ROOT}/typ/index.php [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
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]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
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]
</IfModule>
# END WordPress
# php -- BEGIN cPanel-generated handler, do not edit
# NOTE this account's php is controlled via FPM and the vhost, this is a place holder.
# Do not edit. This next line is to support the cPanel php wrapper (php_cli).
# AddType application/x-httpd-ea-php70 .php .phtml
# php -- END cPanel-generated handler, do not edit
獲得MediaWiki的設備顯示的唯一方法是註釋掉WordPress的線條,就像這樣:
#RewriteBase/
#RewriteRule ^index\.php$ - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]
我的問題是:有沒有辦法讓所有的裝置同時工作?所以https://sub.domain.com
打開WordPress安裝,https://sub.domain.com/wiki
和https://sub.domain.com/typing
打開MEdiawiki安裝?