0

以下に、現在開発中のサイトに使用している現在のvHostエントリを示します。このvHostエントリは、ローカルマシンにある場合は正常に機能しますが、同じvHostレコードを実行しているステージングサーバーにコードをプッシュすると、500InternalServerエラーが発生します。

この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]

あなたが提供できるどんな助けにも感謝します。

よろしく、
アンドリュー

4

1 に答える 1

0

多くの試行錯誤の末、動作するRewriteRuleは次のようになる必要があることがわかりました。

RewriteRule ^.*$ /index.php$1 [PT,QSA,L]

次に、PHPでは、$ _SERVER['PATH_INFO']の代わりに$_SERVER['REQUEST_URI']を使用して、PHPスクリプトが渡されたURIを確実に認識できるようにする必要があります。

于 2010-04-13T06:06:49.620 に答える