gpt4 book ai didi

apache - .HTACCESS 文件导致内部服务器错误

转载 作者:行者123 更新时间:2023-12-02 09:27:45 27 4
gpt4 key购买 nike

我已从 BradPPresents.com 复制了文件和数据库至BradP.com .

由于 joomla! 启用了“漂亮 URL”,因此需要 .htaccess 文件才能使页面正确显示。

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

我将相同的 htaccess 文件从 bradppresents.com(当前工作正常)复制到 bradp.com,当该文件存在时,我收到“内部服务器错误”。一旦删除,错误就会消失,但当然该网站无法按需要运行。

我希望有人能为我照亮这一点。

这是 .htaccess 文件

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 的站点配置文件。

<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>

它本质上是默认文件,但做了一些更改。

我真的很感谢我能得到的任何帮助;太感谢了,尼克

最佳答案

查看错误日志以查看确切的错误消息。

但是既然你在第一句话中说“复制”,我假设你正在从一个主机转移到另一个主机。最可能的原因是新服务器上未加载 rewrite 模块。

关于apache - .HTACCESS 文件导致内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/545442/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com