第一种

    1. <IfModule mod_rewrite.c>
    2. RewriteEngine on
    3. RewriteCond %{REQUEST_FILENAME} !-d
    4. RewriteCond %{REQUEST_FILENAME} !-f
    5. RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
    6. #增加如下内容
    7. SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
    8. </IfModule>

    第二种:

    1. <IfModule mod_rewrite.c>
    2. RewriteEngine on
    3. RewriteCond %{REQUEST_FILENAME} !-d
    4. RewriteCond %{REQUEST_FILENAME} !-f
    5. RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
    6. # Handle Authorization Header
    7. RewriteCond %{HTTP:Authorization} .
    8. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    9. </IfModule>