2011-11-24 47 views
1

我遇到了.htaccess問題。我在主服務器文件夾和通向它的域(adriatic.pl)中有一個網站。不,我已經做了一個新版本的網站,並把它放在「adriatic_new」文件夾中。當我運行adriatic.pl/adriatic_new/public時,everythig工作正常,但是當我將域(adriatic.pl)直接連接到「adriatic_new」文件夾時,出現「500內部服務器錯誤」。將域連接到子文件夾後發生htaccess問題

我發現它可能是.htaccess問題bo如何編輯它使其工作?

它看起來像這樣:

SetEnv APPLICATION_ENV development 
Allow from all 

DirectoryIndex main.php 

RewriteEngine On 

RewriteCond %{DOCUMENT_ROOT}/static/index.html -f 
RewriteRule ^/*$ static/index.html [L] 

RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI}.html -f 
RewriteRule .* static/%{REQUEST_URI}.html [L] 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} ^(.*)/+$ 
RewriteRule ^.*$ %1 [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ main.php [NC,L] 

php_flag magic_quotes_qpc off 
php_flag register_globals off 
+0

你檢查了apache error_log文件的內容,看看爲什麼500錯誤正在生成? – drew010

+0

我現在做了,我得到的是幾十個像這樣的錯誤「[Thu Nov 24 21:57:20 2011] [error] [client 80.239.22.30] script'/ home/adriatic/ftp/adriatic_new/public/news .php「找不到或無法啓動」 – bwitkowicz

+0

我一直在試驗htaccess,現在當我去一些像「http://adriatic.pl/pages/page/id/13」這樣的子頁面時,我沒有找到404文件,打賭,當我輸入這樣的網址「http://adriatic.pl/index.php?pages/page/id/13」,那麼它工作得很好(如果我添加「index.php?」,整個網頁的作品。) – bwitkowicz

回答

3

玉傢伙 - 問題解決(和女士?)。

我所要做的就是在我的.htaccess加上「RewriteBase /」。這麼簡單但又令人困惑和煩人。謝謝。