With your shown rules, could you please try following. In case you are looking for a uri which starts from stats
then change FROM stats
TO ^/stats
in following rules.
RewriteEngine ON
RewriteBase /
# Check if this is the m=no query string
RewriteCond %{QUERY_STRING} (^|&)m=no(&|$)
# Set a cookie, and skip the next rule
RewriteRule ^ - [CO=mredir:0:%{HTTP_HOST},S]
# Check if this looks like a mobile device
RewriteCond %{HTTP:x-wap-profile} !^$ [OR]
RewriteCond %{HTTP:x-wap-profile} !^$ [OR]
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC,OR]
RewriteCond %{HTTP:Profile} !^$
#Check if we're not already on the mobile site
RewriteCond %{HTTP_HOST} ^(?:www.)?website.co.uk$
#Can not read and write cookie in same request, must duplicate condition
RewriteCond %{QUERY_STRING} !(^|&)m=no(&|$)
#Check to make sure we haven't set the cookie before
RewriteCond %{HTTP_COOKIE} !^.*mredir=0.*$ [NC]
#Now redirect to the mobile site
RewriteCond %{REQUEST_URI} !.(?:gif|jpe?g|png|pdf)$ [NC]
RewriteCond %{REQUEST_URI} !stats [NC]
RewriteRule ^ http://m.website.co.uk%{REQUEST_URI} [R,L]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…