View previous topic :: View next topic |
Author |
Message |
acecombat -
Joined: 29 Sep 2005 Posts: 31
|
Posted: Sat Jun 14, 2008 2:58 pm Post subject: Redirect based on user agent |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Sun Jun 22, 2008 7:19 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
acecombat -
Joined: 29 Sep 2005 Posts: 31
|
Posted: Tue Jun 24, 2008 7:46 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|