我有多个 RewriteCond 序列,我希望作为 IF/ELSE 模式工作。即纯文本,它看起来像这样
IF there is no Cookie THEN redirect to other host,
ELSE, Serve the requested file
我有 RewriteCond 如下:
RewriteEngine on
#If there is no cookie in the request fwd the request to ABC
RewriteCond %{HTTP_COOKIE} !^.*Cookie.*$ [NC]
RewriteRule ^(.*)$ http://abc.xyz.com:<port>$1 [P,L]
ProxyPreserveHost On
ProxyPass / http://abc.xyz.com/
ProxyPassReverse / http://abc.xyz.com:<port>/
#else serve the file
RewriteCond %{HTTP:Cookie} ^xxxx-xxxx-xxxx-credentials-a=.*$ [NC]
RewriteRule /([^/]*\.nff).*$ /srv/samba/Assets/$1 [NC,L]
但是,Else RewriteCond 不起作用,即使请求标头有 Cookie,它仍然会被重定向。我有什么遗漏吗?