Htaccess redirecting to mobile site

I need help redirecting mobile users to my mobile website using htaccess.
Here is my code …

#RewriteCond %{QUERY_STRING} !^desktop
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
#RewriteRule ^(fresh|hot|featured|trending)$  https://www.example.com/mobile/$1 [L,R=302]

I also need help with executing two rewrite rules for the same conditions… This is what I tried …

#RewriteCond %{QUERY_STRING} !^desktop
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
#RewriteRule ^(fresh|hot|featured|trending)$  https://www.example.com/mobile/$1 [N,R=302]
#RewriteRule ^member/(fresh|hot|featured|trending)$  https://www.example.com/mobile/member/$1 [L,R=302]

I commented out the code, don’t mind it.

Just a side note, with a properly designed responsive website there’s no need for a secondary mobile site.

1 Like

I know. I want to create a separate site for mobile :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.