重写Apache的PHP应用程序,为/ mydir上的独立文件提供服务

我已经在我的apache服务器的/path上安装了一个php应用程序(dokuwiki),但是我希望在某些/ mydirpath上提供一些不同的文件(不同于dokuwiki的文件)。

目前,/ mydir只是在我的dokuwiki安装中popup一个不存在的页面,但是我希望在这里提供与dokuwiki内容非常不同的内容。

我在我的服务器上安装了dokuwiki在/ var / web / dokuwiki并且我的文件希望在/ var / www / mydir

有没有办法configurationApache服务我的文件,而不会干涉dokuwiki和viceversa?

目前的dokuwiki重写规则生活在.htaccess:

## Enable this to restrict editing to logged in users only # You should disable Indexes and MultiViews either here or in the # global config. Symlinks maybe needed for URL rewriting. Options -Indexes -MultiViews +FollowSymLinks # make sure nobody gets the htaccess, README, COPYING or VERSION files <Files ~ "^([\._]ht|README$|VERSION$|COPYING$)"> Order allow,deny Deny from all </Files> # Uncomment these rules if you want to have nice URLs using # $conf['userewrite'] = 1 - not needed for rewrite mode 2 RewriteEngine on 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 # Not all installations will require the following line. If you do, # change "/dokuwiki" to the path to your dokuwiki directory relative # to your document root. RewriteBase / # If you enable DokuWikis XML-RPC interface, you should consider to # restrict access to it over HTTPS only! Uncomment the following two # rules if your server setup allows HTTPS. RewriteCond %{HTTPS} !=on RewriteRule ^lib/exe/xmlrpc.php$ https://%{SERVER_NAME}%{REQUEST_URI [L,R=301] 

那简单的Alias /mydir/ /var/www/mydir/ ? 你可能需要一个指令来允许访问/var/www/mydir ,否则这只会起作用。 你甚至可以把你的Alias放到networking服务器configuration中,这样你就不必干涉你的wiki安装。