![](/img/trans.png)
[英].htaccess fine on localhost, 500 internal server error on webserver
[英].htaccess of getsimple gets me a 500 Internal Server Error on Ubuntu Localhost
本地主机设置
Ubuntu 12.04
mod重写已启用
在不同目录中运行的多个站点
目录结构
/var/www/mysite1/htdocs/
/var/www/filehostwatch.com/htdocs/
.
.
.
可以在我的getsimple目录中工作的wordpress .htaccess(出于测试原因而复制)没有问题
来自getsimple的那个给了我500服务器遇到内部错误或配置错误...我后来发现这是造成错误的原因
.htacess
AddDefaultCharset UTF-8
现在,导致错误的部分
Options -Indexes
# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
Order allow,deny
Deny from all
Satisfy All
</Files>
<Files sitemap.xml>
Order allow,deny
Allow from all
Satisfy All
</Files>
导致500个错误的部分结尾
RewriteEngine on
# Usually it RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
该站点的/ etc / apache2 / sites-enabled /中的配置文件看起来与另一个运行wordpress的站点没有问题。 正如我所说的,当被复制时,即使在此站点中,wordpress的htaccess也可以工作。
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName filehostwatch.localhost
DocumentRoot /var/www/filehostwatch.com/htdocs
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/filehostwatch.com/htdocs/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
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 ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
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>
任何想法可能导致此问题吗?
您可能应该在有问题的部分中将“ Satisfy All
Satisfy Any
更改为“ Satisfy Any
Satisfy All
,以查看是否有帮助。
AddDefaultCharset UTF-8
Options All -Indexes
# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
Order deny,allow
Deny from all
</Files>
<Files sitemap.xml>
Satisfy Any
Order allow,deny
Allow from all
</Files>
RewriteEngine On
# Usually it RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
如果我正确理解了您的问题... .htaccess
在/var/www/filehostwatch.com/htdocs/
目录中? 在这种情况下,我认为您没有为.htaccess
文件提供足够的权限来配置所需的内容...在虚拟主机设置中,您具有:
<Directory /var/www/filehostwatch.com/htdocs/>
...
AllowOverride FileInfo
...
</Directory>
这提供了更改mod_rewrite设置的功能,但不允许更改主机访问权限(例如Allow
& Deny
)或Options
的更改。
您是否尝试过在虚拟主机配置中将此设置为AllowOverride All
? 或者,您可以将更多指令设置添加到AllowOverride选项。 副手我认为AllowOverride FileInfo Limit Options
应该可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.