.htaccess - Only redirect if not mobile? -
i need create redirect if user agent not mobile. unfortunately can't done.
#rewritecond %{http_user_agent} !"android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [nc,or] rewritecond %{http_host} ^example\.com$ [or] rewritecond %{http_host} ^www\.example\.com$ rewriterule ^/?$ "https\:\/\/example\.com\/home" [r=302,l]
any appreciated. thank you.
got done
# redirect desktop rewritecond %{http_host} ^example\.com$ [or] rewritecond %{http_host} ^www\.example\.com$ rewritecond %{http_user_agent} !(android|blackberry|googlebot-mobile|iemobile|iphone|ipod|opera\smobile|palmos|webos) [nc] rewriterule ^/?$ "https\:\/\/example\.com\/home" [r=302,l] # redirect mobile rewritecond %{http_host} ^example\.com$ [or] rewritecond %{http_host} ^example\.com\/home$ [or] rewritecond %{http_host} ^example\.com$ 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} !^$ rewriterule ^/?$ "https\:\/\/example\.com\/mobile" [r=302,l]