Redirect based on user agent

 
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting
View previous topic :: View next topic  
Author Message
acecombat
-


Joined: 29 Sep 2005
Posts: 31

PostPosted: Sat Jun 14, 2008 2:58 pm    Post subject: Redirect based on user agent Reply with quote

I am trying to setup rewriting based on user agent string so that all clients are directed to /htdocs/adm and 1 particular string is directed to /htdocs/ppc but so that both appear as if they are just mysite.com/ppc/index.html. I setup rewriting as follows but it directs all access including the other agent string to /htdocs/adm/index.html. It's been setup as followed so if anyone could tell me what I did wrong it would be great:

Virtual Path Regular Expression: /ppc/(.+)
Conditions: HTTP Header: User-Agent (HTTP_USER_AGENT) Does not match with Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)
If this rule matches: Perform an internal redirection
Redirect to: /adm/$1
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sun Jun 22, 2008 7:19 pm    Post subject: Reply with quote

Don't know if you got this figured out yet, but...

Change your regex to this: ^/ppc/(.+)

Then go to advanced parameters (at bottom of URL rewriting page) and turn on logging. Then you'll see much more clearly how the rewriting engine is operating. BTW, check the 'log variables' box.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
acecombat
-


Joined: 29 Sep 2005
Posts: 31

PostPosted: Tue Jun 24, 2008 7:46 am    Post subject: Reply with quote

pkSML wrote:
Don't know if you got this figured out yet, but...

Change your regex to this: ^/ppc/(.+)

Then go to advanced parameters (at bottom of URL rewriting page) and turn on logging. Then you'll see much more clearly how the rewriting engine is operating. BTW, check the 'log variables' box.


Don't know what I'm doing wrong. I changed the regex to what you suggested and checked the log file, and the log file is showing the correct agent ID that should be defaulting to /ppc/ but it is still directing it to /adm/ but shows /ppc/ in the URL regardless of the agent ID.
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Tue Jun 24, 2008 1:52 pm    Post subject: Reply with quote

Maybe you could PM me your URL rewriting log or post it on the Code-Bin.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group