.htaccess文件造成内部服务器错误错误、服务器、文件、htaccess

2023-09-02 00:50:18 作者:霸气的

我抄的 BradP presents.com 中的文件和数据库的 BradP.com 。

I have copied the files and database from BradPPresents.com to BradP.com.

.htaccess文件是需要得到的页面,因为pretty的网址正确地显示被启用的Joomla!

The .htaccess file is required to get pages to display properly since "Pretty URLs" are enabled by joomla!.

您可以看到,数据库和所有连接工作在 http://bradp.com/index.php ,但是 http://bradp.com/home.html 不起作用,因为它依赖于.htaccess文件来解析URL。

You can see that the database and all connections are working at http://bradp.com/index.php, however http://bradp.com/home.html does not work as it relies on the .htaccess file to parse the URL.

我复制从bradp presents.com(目前工作正常)相同htaccess文件bradp.com,我得到内部服务器错误时,该文件是present。一旦它被删除的错误消失,但当然需要网站无法正常工作。

I copied the identical htaccess file from bradppresents.com (currently working fine) to bradp.com and I get "Internal server error" when the file is present. As soon as it is deleted the error goes away, but of course the site does not work as needed.

我希望有人能照亮一盏小灯这对我来说。

I'm hoping someone can shine a little light on this for me.

下面是.htaccess文件

Here's the .htaccess file

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} (/|.htm|.php|.html|.aspx|.asp|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php

## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*(.*) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]

#max files size restrictions
php_value upload_max_filesize 20M
php_value post_max_size 20M

下面是来自Apache站点配置文件。

Here's the site configuration file from Apache.

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /home/nick/public_html/bradp.com/html/
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /home/nick/public_html/bradp.com/html/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

它本质上是有一些改变默认的文件。

It's essentially the default file with a few changes.

我真的AP preciate任何帮助,我可以得到; 太感谢了, 尼克

I really appreciate any help I can get; Thanks a million, Nick

推荐答案

。看看你的错误日志看看确切的错误信息。

Look into your error log to see the exact error message.

不过,既然你说的第一句话复制,我以为你是从一台主机移动到另一个。最可能的原因则是,重写模块没有在新服务器上加载。

But since you say "copied" in the first sentence, I assume you are moving from one host to another. The most likely cause then is that the rewrite module is not loaded on the new server.