<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
第一个段代码为正常不需要跨域设置的thinphp伪静态设置,下面代码为需要传输特定标头字符的写法,如签名:Authorization,需要如下书写,否则vue前端传过去,将无法获取到标头中的Authorization,然后出错!
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
SetEnvIf Authorization ^(.*) HTTP_AUTHORIZATION=$1
</IfModule>