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
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Ignoring Rule/Redirection? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
daniel_c
Newbie
Newbie


Joined: 18 August 2002
Location: United States
Online Status: Offline
Posts: 17
Posted: 15 April 2011 at 2:50pm | IP Logged Quote daniel_c

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 View daniel_c's Profile Search for other posts by daniel_c
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 18 April 2011 at 2:11am | IP Logged Quote Anton

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 View Anton's Profile Search for other posts by Anton
 
daniel_c
Newbie
Newbie


Joined: 18 August 2002
Location: United States
Online Status: Offline
Posts: 17
Posted: 19 April 2011 at 11:44am | IP Logged Quote daniel_c

Thank you Anton. That works.
Back to Top View daniel_c's Profile Search for other posts by daniel_c
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
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