Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Redirect and doing special things |
|
Author |
|
ThomasT
Joined: 05 Sep 2018 Posts: 8 Location: Germany
|
Posted: Thu 06 Sep '18 13:42 Post subject: Redirect and doing special things |
|
|
Hi,
although I often used (means devolped something that run in it) apache-webserver I don't have a clue.
I think I descripe what I want to do and hope for tipps.
We want to install a proxy that gets https-request, e.g. for an image. But this request contains a special UUID.
https://myserver/niceimage.jpg?UUID=42
the proxy shall extract (and remove) the uuid and redirect (302) to the actual server providing the requested resources (e.g. https://otherserver/niceimage.jpg).
The uuid shall be written to file or to database or whatever.
The server should be able to process and aswers requests "get all UUIDs you got until now" from outside.
My question how to do this in the most effective way?
I hope its clear what I want. If not, please ask
Regards Thomas |
|
Back to top |
|
mraddi
Joined: 27 Jun 2016 Posts: 152 Location: Schömberg, Baden-Württemberg, Germany
|
Posted: Fri 07 Sep '18 9:10 Post subject: |
|
|
Hello Thomas,
I would use mod_rewrite on myserver to get all requests containing the UUID rewritten to a php-page (of perl or whatever you prefer).
This php-page writes the UUID to the database (including a check if the UUID is alread there) or simply append it to a plain-text-file (which can be processed with the linux-tools sort + uniq "cat uuid.txt | sort | uniq") for analysis. And it redirects the user to the new URL.
The "how-to-rewrite-only-requests-with-defined-parameters" can be found here: https://stackoverflow.com/questions/4703476/what-rewriterule-would-be-to-redirect-based-on-the-on-query-string-parameters
There might be other ways containing more magic but I think this is an easy-to-understand-approach - today when implementing it and in some months/years when looking at it and thinking "how did this work?"
Hope this helps?
Best regards
Matthias |
|
Back to top |
|
ThomasT
Joined: 05 Sep 2018 Posts: 8 Location: Germany
|
Posted: Thu 13 Sep '18 10:11 Post subject: |
|
|
I'll try it. Thanks. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|