2013-01-08 63 views
0

我已經設置'dokuwiki'到我的服務器。
它存儲在/usr/share/wiki文件夾中。
所以路徑是/usr/share/wiki/doku.php爲什麼不這個.htaccess工作?

當我訪問http://example.com/wiki/start,我收到404未找到。

我的.htaccess有什麼問題?
我懷疑,如果有什麼問題RewriteBase

的.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 files 
<Files ~ "^[\._]ht"> 
    Order allow,deny 
    Deny from all 
    Satisfy All 
</Files> 
  
## Uncomment these rules if you want to have nice URLs using 
## $conf['userewrite'] = 1 - not needed for rewrite mode 2 
RewriteEngine on 
# 
## 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 /wiki 
# 
## 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 % !=on 
RewriteRule ^lib/exe/xmlrpc.php$      https://%% [L,R=301] 

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 %       !-f 
RewriteCond %       !-d 
RewriteRule (.*)                      doku.php?id=$1  [QSA,L] 
RewriteRule ^index.php$               doku.php 

等/的httpd/conf.d

# enter the following in pico 
Alias /wiki/ "/usr/share/wiki/" 
Alias /wiki "/usr/share/wiki/" 
<Directory "/usr/share/wiki/" > 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride None 
    Order allow,deny 
    Allow from all 
    Deny from none 

</Directory> 

回答

1
#Fix Rewrite 
Options -Multiviews 


# Mod Rewrite 
Options +FollowSymLinks 
RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 

或使用線下最後

RewriteRule ^(.*)$ index.php/$1 [PT,L] 

對不起延遲..

+0

用你的代碼替換整個.htaccess? – Foo

+0

這仍然是一樣的... – Foo

+0

你能檢查一下嗎? https://www.dokuwiki.org/rewrite – Foo

0

它是不是在你的本地主機正常工作?

如果是,您必須根據您的託管服務器修改.htaccess

因爲託管服務器多次託管多個站點。並且他們相應地具有不同的.htacces

+0

這是VPS是的,我有根authirity所以我在其他文件夾中使用其他的.htaccess過。 – Foo

+0

從** RewriteBase **中刪除維基,然後重試..我不確定,但它可以幫助 – KAsh

+0

我現在試過了#未找到 未在此服務器上找到請求的網址/維基/山羊.. – Foo