logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: mod_rewrite help needed to differentiate sessions
Author
sinaowolabi



Joined: 05 Nov 2014
Posts: 2

PostPosted: Wed 05 Nov '14 19:16    Post subject: mod_rewrite help needed to differentiate sessions Reply with quote

Hi!

Please I need some assistance with mod_rewrite, which works a little TOO well Smile

I am trying to capture 3-4 digits when sent as part of a URL, for them to be proxied to another URL. I have no control over how the source sends this data, I am supposed to redirect it. Which works.

#RewriteCond %{HTTP:something-simple} ([\d]{2,4})
#RewriteRule ^/original/individual.do(.*)$ https://other.server.com/somewhere/011$1 [P]

The problem is this works for all URLs that have digits to this server.
I am expecting to trap URLs that send digits as part of the first call to the server, but this also affects URL calls that are part of other server call transactions, once digits appear, it gets redirected.
Please what can I do to stop this interference?

Thanks!


Last edited by sinaowolabi on Mon 30 May '16 19:12; edited 1 time in total
Back to top
sinaowolabi



Joined: 05 Nov 2014
Posts: 2

PostPosted: Tue 11 Nov '14 11:15    Post subject: Reply with quote

Fixed it:


RewriteCond %{HTTP:something-simple} ^\d{3,4}$
#do not honor if string is found
RewriteCond %{QUERY_STRING} !string= [NC]
RewriteRule ^/original/individual.do(.*)$ https://some.other/site/011$1 [L,P]
Back to top


Reply to topic   Topic: mod_rewrite help needed to differentiate sessions View previous topic :: View next topic
Post new topic   Forum Index -> Apache