This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Ignoring Rule/Redirection?
Author
Message |
daniel_c
Newbie


Joined: 18 August 2002
Location: United States
Posts: 17
Posted: 15 April 2011 at 2:50pm

We have this rule:


RewriteCond User-Agent: .*(?:iphone|ipad|android|mobile/|openweb|cldc\-1|nokia|symbianos|up.link|up.browser|avantgo|sonyericsson|netfront|blackberry|enews\screator|pg\-c300|palmsource|palm7|palmos|docomo|mib/2|mib/ber|googlebot\-mobile|smartphone|mobilephone|iemobile|t\-mobile|motorola|opera\smini|samsung\-|vodafone|windows\sce|midp\-2|midp\-1|opwv|audiovox|sonyericsson|alcatel|sharpreader|320x320|240x320|176x220|320x240|320x448|400x240|240x240|448x320|160x160|440x240).*
RewriteRule (.*) http://m.mysite.org$1 [I,R]       


which basically redirect our site to the mobile version if it is accessed through the mobile phone.

Now, our question is there a way to ignore this using specific query string?
For example:
If from mobile phone, I access: http://mysite.org/?nomobile, then even it is accessed through the mobile phone, it still show the standard website instead of redirecting to the mobile phone?


Thanks in advance for your help.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 18 April 2011 at 2:11am

Sure we can do it.
Please try to fix your rule like this:

RewriteRule (?!.*\?nomobile.*)(.*) http://m.mysite.org$1 [I,R]

__________________
Regards,
Anton
Back to Top
 
daniel_c
Newbie


Joined: 18 August 2002
Location: United States
Posts: 17
Posted: 19 April 2011 at 11:44am

Thank you Anton. That works.
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum