【问题标题】:RewriteEngine On - Internal Server ErrorRewriteEngine On - 内部服务器错误
【发布时间】:2015-11-25 11:25:12
【问题描述】:

我遇到了 Linux 服务器的问题。

配置: Linux 服务器 3.2.0-4-686-pae #1 SMP Debian 3.2.65-1+deb7u2 i686

Apache/2.2.22 (Debian)

PHP/5.4.39-0+deb7u2

ModRewrite 已开启 (a2enmod)

我的 htaccess 看起来像:

<IfModule mod_rewrite.c>
Options -MultiViews +SymLinksIfOwnerMatch

#RewriteEngine On
RewriteBase /var/www/git

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L,NC]
</IfModule>
<Files config.ini>
order allow,deny
deny from all
</Files>

当我取消注释 #RewriteEngine On 我得到内部服务器错误

我在 Apache 中可用的站点如下所示:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/git
ServerName git.server.com
Alias /git /var/www/git

RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 5

<Directory /var/www/git>
    Options FollowSymLinks
    AllowOverride All
    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
</VirtualHost>

您有解决问题的想法吗? 谢谢

【问题讨论】:

  • 你检查你的服务器错误日志了吗?
  • 当然我有,例如:[Mon Aug 31 13:28:00 2015] [error] [client 192.168.0.23] 文件不存在:/var/www/git/refresh,referer :git.server.com 还有很多这样的。没有更多有用的信息。
  • 该文件不存在,这是真的,但在这种情况下有htaccess。我认为...

标签: php linux apache .htaccess mod-rewrite


【解决方案1】:

解决了将 /var/www/git 替换为 /

无论如何感谢您的建议。

【讨论】:

    猜你喜欢
    • 2016-11-15
    • 2011-07-19
    • 1970-01-01
    • 2011-12-01
    • 2015-07-01
    • 2011-07-28
    • 1970-01-01
    • 2017-04-12
    相关资源
    最近更新 更多