开发者

Best way to rewrite modern browsers to modern version of app?

开发者 https://www.devze.com 2023-01-14 10:23 出处:网络
I have a Flash app at URL-A. I have a new non Flash version, that only works in modern browsers at URL-B. I can redirect all visitors from URL-A to URL-B with .htaccess or PHP but I wont know what bro

I have a Flash app at URL-A. I have a new non Flash version, that only works in modern browsers at URL-B. I can redirect all visitors from URL-A to URL-B with .htaccess or PHP but I wont know what browser they have in order to determine if I need to redirect or not.

So I am not sure what the best way to go about this is.

Basically if you are using IE8+, FF, Chrome, Safar, Opera I want you to go t开发者_开发知识库o URL-B. If you are using IE7- I want you to go to URL-A

Whats the best way to do this?


If you have no problem with using a small PHP library, look at the answer to this question and do a header("Location:url") redirect depending on which result you get.

If you'd rather use a .htaccess file, you could parse the USER_AGENT as shown in this question (it's aimed at mobile browsers but doesn't really matter). The PHP solution is much more convenient though.

0

精彩评论

暂无评论...
验证码 换一张
取 消