Hi,
this seems to be very tricky.
So I found this in the net which seems to be roughly what I need:
RewriteCond %{QUERY_STRING} ^prod=([^&]+)$
RewriteRule ^.*$ /%.html [R=301,L]
Now what I would need is two conditions, right?
a) The query string condition and
b) the rest of the path rewriting
Is there a way to have two query conditions for one rule?
Or do I have to change that in two rules first the ^/appname(.*)/
(.*)/(.*) and
after that put the query string var into that URL?
Or will that work:
RewriteCond %{QUERY_STRING} ^apn=([^&]+)$
RewriteRule ^/appname(.*)/(.*)/(.*)% /cgi-bin/WebObjects/appname.woa/
$1/wa/ttcms?a1=%1&a2=%2 [last,passthrough]
Or is the Use of % different? Do I need $ in both lines and if yes,
is that possible?
Regards,
Ute
Am 13.04.2010 um 00:58 schrieb Sacha Michel Mallais:
On Apr 12, 2010, at 3:33 PM, Chuck Hill wrote:
On Apr 12, 2010, at 3:17 PM, ute Hoffmann wrote:
Hi,
does anyone see why apache will not let me have a rewrite rule
like this:
RewriteRule ^/appname(.*)/(.*)/(.*)?apn=(.*)$ /cgi-bin/WebObjects/
appname.woa/$4/wa/ttcms?a1=$1&a2=$2 [last,passthrough]
RewriteRule ^/appname\.(.+)/(.+)/(.+)?apn=(.+) /cgi-bin/
WebObjects/appname.woa/$4/wa/ttcms?a1=$1&a2=$2 [last,passthrough]
Neither of these will likely work the way you are expecting. You
cannot use RewriteRule to rewrite GET params (after the "?").
Before the rewrite engine gets the URL, the stuff after the ? will
be stripped out and put into the QUERY_STRING (IIRC) env var.
There are Rewrite engine directives that will give you access to
env vars and allow you to manipulate them, but I can't remember
them off the top of my head.
sacha
--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc. http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-deploy/archive%40mail-archive.com
This email sent to [email protected]