Forum Moderators: phranque
Welcome to WebmasterWorld!
Our policy, as noted in our charter [webmasterworld.com], is to help you get your code working, but we cannot write it for you. There are several examples of rewrites similar to what you need posted here in this forum. Please review the documentation using the links provided in our charter, try to write a rewriterule to do what you need, and post questions about your code if it does not work.
Jim
i've been trying to write this rule for two days. i should posted my code. :)
the issue that i'm having is that i can't just relocate the query_string across because they differ from the CGI and the Java app. ie:
cgi = ispSelector?isp=blah
and the java =?process=enrollment&ispcrossover-enrollment.isp-code=blah
all i want to do is take the "blah" from the CGI post and slap it at the end of the ...isp-code=$1
i need to get this working asap... i'll pay money. :)
RewriteCond %{QUERY_STRING} isp=([^&]+)
Back-references %1 through %9 can be used to access RewriteCond subpattern matches in the same way that $1 through $9 are used to access RewriteRule subpattern matches. However, within a given RewriteRule, back-references will only be available to the last-matched RewriteCond, so be aware of this restriction if you use multiple RewriteConds for a rule.
Jim
thanks very much for the tip!
this is my rule....
RewriteEngine on
RewriteLog /var/log/apache/redirect.log
RewriteLogLevel 1
RewriteCond %{QUERY_STRING} isp=([^&]+)
RewriteRule ^/cgi/server/ispSelector.exe$ [server...] [R]
if i try and access it just redirects me to [server...] and ommits the value of $1.
%3f is an ASCII question mark character. It is possible that the output of this rule is being processed by subsequent rules, one of which is attempting to append an addtional blank query string. Try using a [L] flag to tell mod_rewrite to quit after this rule is invoked:
RewriteRule ^/cgi/server/ispSelector.exe$ https://server/process?process=enrollment.isp-code=%1 [R,[b]L[/b]]
[edited] Fixed %1 in rule to reflect corrected code per post #6 [/edited]
[edited by: jdMorgan at 2:12 pm (utc) on Aug. 24, 2004]