Php .htl5和http授权的访问规则
我有以下.htaccess文件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文件中指定这两
<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']