您将在下面找到我正在使用的当前vHost条目,该网站目前正在开发中。这个vHost条目在我的本地机器上运行时工作正常,但是当我将代码推送到运行同一个vHost记录的登台服务器时,我收到500内部服务器错误。
我正在运行此vHost的机器正在运行Apache 2.2.9(Debian)。
<VirtualHost 206.217.196.61:80>
SuExecUserGroup 13labs 13labs
ServerAdmin aellis@1three.com
ServerName admin.13labs.net
ServerAlias admin.13labs.net
DirectoryIndex index.php
DocumentRoot /var/www/13labs.net/html/admin/
ErrorLog /var/www/13labs.net/logs/error.log
# Hide .svn Directories
<DirectoryMatch "\.svn">
Order deny,allow
deny from all
</DirectoryMatch>
# FastCGI
Alias /fcgi-bin/ /var/www/13labs.net/fcgi-bin/
AddHandler php-fastcgi .php
AddType application/x-httpd-php .php
Action php-fastcgi /fcgi-bin/admin-php.fcgi
<Directory /var/www/13labs.net/fcgi-bin/>
SetHandler fcgid-script
AllowOverride None
Options -Indexes +ExecCGI -FollowSymlinks -SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/13labs.net/html/admin/>
AllowOverride None
Options -Indexes -FollowSymlinks -SymLinksIfOwnerMatch
FileETag All
</Directory>
# Rewrite Logic
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^/(.+)$ /index.php/$1 [PT,QSA,L]
感谢您提供的任何帮助。
最好的问候,
安德鲁
答案 0 :(得分:0)
经过多次试验和错误后,我发现工作的RewriteRule需要如下:
RewriteRule ^.*$ /index.php$1 [PT,QSA,L]
然后在PHP中我需要使用$ _SERVER ['REQUEST_URI']而不是$ _SERVER ['PATH_INFO']来确保我的PHP脚本看到传入的URI。