2011-11-24 88 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 /”。这么简单但又令人困惑和烦人。谢谢。