问题描述
我试着去重定向使用htaccess的一个网页,建议更新他们的浏览器,我不能算出它的.htaccess文件一些浏览器:
目前我使用的:
的RewriteCond%{HTTP_USER_AGENT}MSIE 6
的RewriteCond%{REQUEST_URI}!^ / IE /
但只传递Internet Explorer 6中如何添加更多的浏览器,我在哪里可以找到他们的USER_AGENT的名字?我发现这篇文章在网上: http://evansims.com/6032/使用-htaccess的到重定向过时,浏览器/ 这表明这样的:
的RewriteCond%{HTTP_USER_AGENT}歌剧/ 3[或]
的RewriteCond%{HTTP_USER_AGENT}歌剧/ 2[或]
的RewriteCond%{HTTP_USER_AGENT}歌剧/ 1[或]
的RewriteCond%{HTTP_USER_AGENT}野生动物园/ 4[或]
的RewriteCond%{HTTP_USER_AGENT}野生动物园/ 3[或]
的RewriteCond%{HTTP_USER_AGENT}野生动物园/ 2[或]
的RewriteCond%{HTTP_USER_AGENT}Safari浏览器/ 1[或]
的RewriteCond%{HTTP_USER_AGENT}导航/[或]
的RewriteCond%{HTTP_USER_AGENT}MSIE 6[或]
的RewriteCond%{HTTP_USER_AGENT}MSIE 5[或]
的RewriteCond%{HTTP_USER_AGENT}MSIE 4[或]
的RewriteCond%{HTTP_USER_AGENT}MSIE 3[或]
的RewriteCond%{HTTP_USER_AGENT}MSIE 2[或]
的RewriteCond%{HTTP_USER_AGENT}MSIE 1
重写规则。 upgrade.html [L]
但它似乎并没有为我工作。是否有提供了大批量的HTTP用户代理列表中的任何网站?例如,当我说的Firefox 3.0则意味着所有版本,包括3.6
此网站: http://www.useragentstring.com/pages/Firefox/ 有数百个用户代理的其中林pretty的肯定有一种方法,包括在一排所有这些吗? (像IE6,7火狐1至3个(包括3.6),歌剧1至10等)
的RewriteCond%{HTTP_USER_AGENT}歌剧/ [1-3] [OR]
的RewriteCond%{HTTP_USER_AGENT} Safari浏览器/ [1-4] [OR]
的RewriteCond%{HTTP_USER_AGENT}导航/ [OR]
的RewriteCond%{HTTP_USER_AGENT} MSIE [1-6]
重写规则? upgrade.html [L]
这应该更好地工作。
Im trying to redirect few browsers using htaccess to a page that would suggest to update their browser and I cant figure it out with the .htaccess file:
Currently I am using:
RewriteCond %{HTTP_USER_AGENT} "MSIE 6"
RewriteCond %{REQUEST_URI} !^/ie/
but that transfers only internet explorer 6. How can I add more browsers and where can I find their user_agent names? I found this article online: http://evansims.com/6032/using-htaccess-to-redirect-obsolete-browsers/ which suggests this:
RewriteCond %{HTTP_USER_AGENT} "Opera/3" [or]
RewriteCond %{HTTP_USER_AGENT} "Opera/2" [or]
RewriteCond %{HTTP_USER_AGENT} "Opera/1" [or]
RewriteCond %{HTTP_USER_AGENT} "Safari/4" [or]
RewriteCond %{HTTP_USER_AGENT} "Safari/3" [or]
RewriteCond %{HTTP_USER_AGENT} "Safari/2" [or]
RewriteCond %{HTTP_USER_AGENT} "Safari/1" [or]
RewriteCond %{HTTP_USER_AGENT} "Navigator/" [or]
RewriteCond %{HTTP_USER_AGENT} "MSIE 6" [or]
RewriteCond %{HTTP_USER_AGENT} "MSIE 5" [or]
RewriteCond %{HTTP_USER_AGENT} "MSIE 4" [or]
RewriteCond %{HTTP_USER_AGENT} "MSIE 3" [or]
RewriteCond %{HTTP_USER_AGENT} "MSIE 2" [or]
RewriteCond %{HTTP_USER_AGENT} "MSIE 1"
RewriteRule . upgrade.html [L]
but it doesn't seem to work for me. Is there any website that provides a list with the http user agents in bulk? For example when I say Firefox 3.0 it means all versions including 3.6
This website: http://www.useragentstring.com/pages/Firefox/ has hundreds of user agents which Im pretty sure there is a way to include all of them in one row? ( Like IE6,7 Firefox 1 to 3 (including 3.6), Opera 1 to 10 etc )
RewriteCond %{HTTP_USER_AGENT} Opera/[1-3] [OR]
RewriteCond %{HTTP_USER_AGENT} Safari/[1-4] [OR]
RewriteCond %{HTTP_USER_AGENT} Navigator/ [OR]
RewriteCond %{HTTP_USER_AGENT} MSIE [1-6]
RewriteRule .? upgrade.html [L]
This should work better.
这篇关于使用的.htaccess重定向过时的浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!