プロジェクト

全般

プロフィール

Vote #66306

未完了

.htaccess redirect rules not working when multiple CGI/FastCGI modules enabled

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Permissions and roles_17
対象バージョン:
-
開始日:
2010/01/08
期日:
進捗率:

0%

予定工数:
category_id:
17
version_id:
0
issue_org_id:
4538
author_id:
10891
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

I just noticed something strange, using the default .htaccess file, when both mod_cgi and mod_fcgid were enabled. These are the default rewrite rules:

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f

        RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]


        RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]


       RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

With both mod_cgi and mod_fcgid, this translates to:

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

This means: non-static files are served through dispatch.fcgi (as expected), but when the RewriteCond doesn't match (i.e. it's a request for an existing static file) the request is sent through to the 2nd RewriteRule -- which ends you up with lots of CGI processes all not able to serve your images/CSS.

A better solution would be to use something like this, to make sure that only one RewriteRule can be active:


        RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]


    
        RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    
    
       
          RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
       
    


journals

--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリPermissions and roles_17 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0