【发布时间】:2011-09-08 08:24:32
【问题描述】:
当用户没有从手机进入网站时,我想用 .htaccess 检测用户浏览器并重定向
【问题讨论】:
-
@SalmanPK,它不是重复的
-
@SalmanPK,但我想用 .htaccess 来做
标签: php html .htaccess wap wml
当用户没有从手机进入网站时,我想用 .htaccess 检测用户浏览器并重定向
【问题讨论】:
标签: php html .htaccess wap wml
你可以从here开始举个例子。
# Rewrite requests from all user-agents except modern Internet Explorer, Firefox, Opera
RewriteCond %{HTTP_USER_AGENT} !^Mozilla/4\.[0-9]+\ \(compatible;\ MSIE\ [0-9.]+
RewriteCond %{HTTP_USER_AGENT} !^Mozilla/5\.0 \(([^;]+;\ )*[^;]+\)\ Gecko/2[0-9]{3}\ Firefox/[0-9.]+
RewriteCond %{HTTP_USER_AGENT} !^Opera/[0-9.]+
RewriteRule .* X.html [L]
根据需要进行调整。
【讨论】: