Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .htl5和http授权的访问规则_Php_Angularjs_Html_.htaccess_Mod Rewrite - Fatal编程技术网

Php .htl5和http授权的访问规则

Php .htl5和http授权的访问规则,php,angularjs,html,.htaccess,mod-rewrite,Php,Angularjs,Html,.htaccess,Mod Rewrite,我有以下.htaccess文件 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) /index.php/#/$1 </IfModule> 如何在.htaccess文件中指定这两

我有以下.htaccess文件

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)       /index.php/#/$1


</IfModule>
如何在.htaccess文件中指定这两个规则? 在
部分末尾添加第二行
HTTP\u AUTHORIZATION
相关行,会使PHP无法从PHP调用中访问授权头

我是.htaccess的新手,非常感谢您的帮助。

所以我找到了答案。。 正确的方法是

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*)       /index.php/#/$1
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]

</IfModule>

重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则(.*)/index.php/#/$1
重写规则。*-[env=HTTP\u授权:%{HTTP:AUTHORIZATION},last]
对我不起作用。
我做到了:

然后发现承载令牌隐藏在:

$_SERVER['REDIRECT_HTTP_AUTHORIZATION']
print_r($_SERVER);
$_SERVER['REDIRECT_HTTP_AUTHORIZATION']