It turns out it isn't matching, but only due to operator error. After
spending hours on this I've come up with a solution. A few things I've
learned:
(1) You can't get query string info in a RewriteRule.
(2) In this case I need to do make the RewriteRule redirect and not proxy
RewriteCond %{QUERY_STRING} ^([0-9]+) [NC]
RewriteRule ^/db\.acgi\$foo\.detail$
https://%{HTTP_HOST}/foo/detail.a4d?id=%1 [NC,R=301,L]
You can get the query param value from RewriteCond. It will be available
as %1 in your RewriteRule.
A reverse proxy will work but the URL will remain unchanged. The result
will be the A4D page, but any further actions with that page, e.g.,
posting a form might not work as expected.
-- Brad
On 4/13/12 4:41 PM, "Aparajita Fishman" <[email protected]>
wrote:
>> If I have
>>
>> http://www.example.org/db.acgi$foo.detail?1234
>>
>> I would like to serve:
>>
>> http://www.example.org/foo/detail.a4d?id=1234
>>
>> More specifically I want it to reverse proxy to
>>
>> http://localhost:8080/foo/detail.a4d?id=1234
>>
>> I'm fairly adept at regex, but I can't seem to figure out the
>>mod_rewrite
>> part where
>>
>> * the request was for db.acgi$foo.detail
>> * the id of that request was 1234
>>
>> I have something like this:
>>
>> RewriteRule ^/db\.acgi\$foo\.detail\?(.+)$
>> http://localhost:8080/foo/detail?id=$1 [NC,P]
>> ProxyPassReverse / http://localhost:8080
>
>You're saying it isn't matching, or it isn't rewriting the correct url?
>
>Regards,
>
> Aparajita
> www.aparajitaworld.com
>
> "If you dare to fail, you are bound to succeed."
> - Sri Chinmoy | www.srichinmoy.org
>
>_______________________________________________
>Active4D-dev mailing list
>[email protected]
>http://list.aparajitaworld.com/listinfo/active4d-dev
>Archives: http://vasudev.aparajitaworld.com/archive/active4d-dev/
_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://vasudev.aparajitaworld.com/archive/active4d-dev/