2015-12-16 61 views
0

每當我點擊某個網址時,我都會得到一個404。這是因爲無法找到頁面。但是,當我在.domain後面添加一個問號時,就會找到該頁面。當我將網站託管在子域文件夾中時,這不是問題。需要問號才能訪問一個頁面,我不想問問號。無法訪問鏈接而不在URL中添加問號

請參閱網址:http://www.ankehesselmann.nl/

我使用StaceyApp

這是我的.htaccess

RewriteEngine on 
 

 
# Some hosts require a rewritebase rule, if so, uncomment the RewriteBase line below. If you are running from a subdirectory, your rewritebase should match the name of the path to where stacey is stored. 
 
ie. if in a folder named 'stacey', RewriteBase /stacey 
 
RewriteBase /stacey 
 

 
ErrorDocument 404 /404.html 
 

 
# Rewrite any calls to *.html, *.json, *.xml, *.atom, *.rss, *.rdf or *.txt if a folder matching * exists 
 
RewriteCond %{REQUEST_FILENAME} !-f 
 
RewriteCond %{REQUEST_URI} !public/ 
 
RewriteCond %{DOCUMENT_ROOT}/public/$1.$2 !-f 
 
RewriteRule (.+)\.(html|json|xml|atom|rss|rdf|txt)$ $1/ [L] 
 

 
#Add a trailing slash to directories 
 
RewriteCond %{REQUEST_FILENAME} !-f 
 
RewriteCond %{REQUEST_FILENAME} !-d 
 
RewriteCond %{REQUEST_URI} !(\.) 
 
RewriteCond %{REQUEST_URI} !(.*)/$ 
 
RewriteRule ([^/]+)$ $1/ [L] 
 

 
# Rewrite any calls to /* or /app to the index.php file 
 
RewriteCond %{REQUEST_URI} /app/$ 
 
RewriteRule ^app/ index.php [L] 
 
RewriteCond %{REQUEST_FILENAME} !-f 
 
RewriteCond %{REQUEST_FILENAME} !-d 
 
RewriteRule ^(.*)/$ index.php?$1 [L] 
 

 
# Rewrite any file calls to the public directory 
 
RewriteCond %{REQUEST_FILENAME} !-f 
 
RewriteCond %{REQUEST_FILENAME} !-d 
 
RewriteCond %{REQUEST_URI} !public/ 
 
RewriteRule ^(.+)$ public/$1 [L]

回答

0

我猜RewriteBase設置爲錯誤的文件夾在您的.htaccess 雖然我不能解釋爲什麼它與t他如你所說的問號,我會嘗試正確設置RewriteBase。

如果您有任何問題,您必須放置子文件夾(從域名到您的索引文件的路徑)。例如:

網站,網址爲:example.com/folder1/sub/

RewriteBase /folder1/sub/ 

如果您的網站沒有一個子文件夾:

RewriteBase/

你也可以嘗試刪除線如果你沒有一個子文件夾,但是如果設置爲/(斜線),它不應該出現任何問題。