Lookup to convert FQDN hostname to numeric URL parameter

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
JohnEDee
-


Joined: 30 Jan 2019
Posts: 15

PostPosted: Tue Jan 21, 2020 10:31 pm    Post subject: Lookup to convert FQDN hostname to numeric URL parameter Reply with quote

Thre are a lot of ways to transform a URL in Abyss, so I wanted to see what the (far more experienced) community thought might be the best way to accomplish what I need to do. I'm a developer so I don't need step-by-step instructions or anything, just someone who knows all the options pretty well to point me in the right direction for the technology that will best and most simply accomplish it.

I have URLs coming with FQDNs like "https://hostname.domain1.com", where "hostname" will vary (I know that HTTP calls the entire thing "hostname", but I'm referring to the FQDN meaning, i.e. the first word after "//").

I need to extract the hostname from the URL, then look it up in a delimited text file or a two-dimensional matrix in memory, where there will be a one-to-one correspondence from the hostname to an integer.

After looking up the corresponding integer, I need to construct a new URL like
Code:
https://static.domain2.com/Program.aspx?aff=<integer>

and then redirect to it.

I know there are multiple ways to accomplish this with various web technologies, but I'd like to set it up so that that a techie with minimum skill can add or modify the lookups, i.e. someone can edit a text file with tab-separated values to change the redirection, or something can be easily modified in the Abyss config. I know I could spend a lot of time writing something that does input validation and uses a database, but I don't have the time for that, so I'd like to keep it simple.

Thanks for any hints on what to use to accomplish this.

John
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1052

PostPosted: Thu Jan 23, 2020 5:13 pm    Post subject: Re: Lookup to convert FQDN hostname to numeric URL parameter Reply with quote

JohnEDee,

This could be done using a simple script or .aspx page directly. Or do you need to have it handled entirely by Abyss Web Server?

What languages can you use (PHP or a .NET language)?
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
JohnEDee
-


Joined: 30 Jan 2019
Posts: 15

PostPosted: Fri Jan 24, 2020 8:54 pm    Post subject: Reply with quote

Thanks! I do need to do it completely within Abyss, running on macOS. I prefer PHP over .NET.
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1052

PostPosted: Mon Jan 27, 2020 5:19 pm    Post subject: Reply with quote

JohnEDee wrote:
Thanks! I do need to do it completely within Abyss, running on macOS. I prefer PHP over .NET.


URL Rewriting rules in Abyss Web Server cannot be used to lookup a table from a file and use the result. So using PHP is your only solution as it will offer the way to do the lookup and redirect to the right URL.
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
JohnEDee
-


Joined: 30 Jan 2019
Posts: 15

PostPosted: Thu Jan 30, 2020 3:54 pm    Post subject: Reply with quote

Got PHP installed and running and my little app is converting URLs as I write this. Thanks for the help!
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1052

PostPosted: Tue Feb 04, 2020 5:39 pm    Post subject: Reply with quote

JohnEDee wrote:
Got PHP installed and running and my little app is converting URLs as I write this. Thanks for the help!


Glad to get your feedback and to know that you implemented our suggestion.
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group