【发布时间】:2015-06-22 14:18:26
【问题描述】:
我的服务器有问题。它给出 500 内部服务器错误。
我的 domain.conf 在 sites-available 下看起来像这样:
<VirtualHost *:80>
ServerName domain.com
ServerAdmin hello@domain.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
我的 apache2.conf 看起来像这样:
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
我的 .htaccess 文件如下所示:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.domain\.com|188\.166\.104\.193)$ [NC]
RewriteRule (.*) http://domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
RewriteRule ^([^/]+)/$ $1.php [L]
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php [L]
我不明白问题出在哪里。它给出 500 间隔服务器错误。
你能帮我解决这个问题吗?
最好的问候。
【问题讨论】:
-
你也可以发布日志吗?可能是权限,但无论如何......我认为这篇文章可能属于superuser
-
是的,.htaccess 上的 ExpiresActive 行存在问题。在这里你可以看到 .htaccess 的其余部分:pastebin.com/nYBivS4r
-
你试过我的答案了吗?结果如何?
标签: apache .htaccess mod-rewrite