Title: Multisite Mobile Redirect
Last modified: August 20, 2016

---

# Multisite Mobile Redirect

 *  Resolved [tiaanswart](https://wordpress.org/support/users/tiaanswart/)
 * (@tiaanswart)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/)
 * Hello
 * I want to redirect all users with a mobile browser to one of my network sites.
   Multisite is setup with subdirectories in this case “/mobile” is the mobile site.
 * In my .htaccess file i placed the below code but for somereason it does not redirect?
   Please help!
 *     ```
       RewriteEngine On
       RewriteCond %{REQUEST_URI} !^/mobile/.*$
       RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT}  "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
       RewriteRule ^(.*)$ /mobile/ [L,R=302]
       ```
   

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895330)
 * So you have multisite installed in domain.com
 * And you have a subsite of ‘mobile’
 * Did you put that code above the WP calls?
 *  Thread Starter [tiaanswart](https://wordpress.org/support/users/tiaanswart/)
 * (@tiaanswart)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895340)
 * Yes i tried both, above and underneath the standard wp calls? Any ideas?
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895358)
 * First, always put it above 🙂
 * Second, I think it should start with
 *     ```
       RewriteCond %{REQUEST_URI} !^mobile/.*$
       ```
   
 *  Thread Starter [tiaanswart](https://wordpress.org/support/users/tiaanswart/)
 * (@tiaanswart)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895359)
 * Hi
 * Thanks a million! it worked however when on a mobile browser the redirect times-
   out with error: “Exceeded maximum redirect attempts to server”
 *  Thread Starter [tiaanswart](https://wordpress.org/support/users/tiaanswart/)
 * (@tiaanswart)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895360)
 * Also now when going to the mobile site directly i get the same error: “Exceeded
   maximum redirect attempts to server”
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895365)
 * Hmm.
 * Have you read this post? [http://wordpress.org/support/topic/how-to-redirect-links-for-mobile-using-htaccess?replies=10](http://wordpress.org/support/topic/how-to-redirect-links-for-mobile-using-htaccess?replies=10)
 *  Thread Starter [tiaanswart](https://wordpress.org/support/users/tiaanswart/)
 * (@tiaanswart)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895366)
 * hahaha yes i’ve tried everything before coming here…
 * nothing seems to work right 🙁
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895367)
 * It’s trickier with Multisite because it redirects things by default :/ So you’re
   redirecting and redirecting (and this is part of why mobile responsive themes
   are all the rage).
 *  Thread Starter [tiaanswart](https://wordpress.org/support/users/tiaanswart/)
 * (@tiaanswart)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895424)
 * Hi Ipstenu
 * I finally got this working after a long battle with WP MU Subdomain setup (and
   my host not being very helpful) I was able to setup a mobi site. (mobi.domain.
   co.za).
 * I then added the below code to my htaccess header…
 *     ```
       RewriteEngine on
       RewriteBase /
       RewriteCond %{QUERY_STRING} (^|&)m=0(&|$)
       RewriteRule ^ - [CO=mredir:0:www.domain.co.za]
       RewriteCond %{HTTP:x-wap-profile} !^$ [OR]
       RewriteCond %{HTTP:Profile}       !^$ [OR]
       RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT}  "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
       RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
       RewriteCond %{HTTP_USER_AGENT} !macintosh [NC]
       RewriteCond %{HTTP_HOST}          !^mobi\.
       RewriteCond %{QUERY_STRING} !(^|&)m=0(&|$)
       RewriteCond %{HTTP_COOKIE}        !^.*mredir=0.*$ [NC]
       RewriteRule ^ http://mobi.domain.co.za [R,L]
       ```
   
 * And Viola…
 * It worked 🙂
 * Thanks a mil!
    T

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Multisite Mobile Redirect’ is closed to new replies.

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [mobile](https://wordpress.org/support/topic-tag/mobile/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 9 replies
 * 2 participants
 * Last reply from: [tiaanswart](https://wordpress.org/support/users/tiaanswart/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/multisite-mobile-redirect/#post-2895424)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
