cookie和url使用mod_rewrite检查重定向

时间:2013-10-23 09:40:06

标签: apache .htaccess mod-rewrite redirect

我需要首次重定向网站 因此,访问我的网站清洗cookie的所有用户都被重定向到促销页面 决定使用apache中的mod_rewrite

来做到这一点

我在.htaccess

中这样做了
RewriteEngine on
RewriteCond %{HTTP_COOKIE} !first-time=true
RewriteRule ^(.*)$ http://promo.mysite.com/ [CO=first-time:true:.mysite.com:43200:/,R,L]

这个工作效果很好,但过了一段时间后我发现我的PayPal通知页面无法用于PayPal,所以我需要将其从我的重定向中排除

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/paypal/notify
RewriteCond %{HTTP_COOKIE} !first-time=true
RewriteRule ^(.*)$ http://promo.mysite.com/ [CO=first-time:true:.mysite.com:43200:/,R,L]

但它没有用,我不明白为什么 你能帮助我吗?

0 个答案:

没有答案
相关问题