Perl or bash script to redirect traffic to another site.
This would be great. I know somebody works with these scripts and uses them all the time. My problem is I don’t.
Thank you for reading! |
Quote:
Past that, you provide no details; version/distro of Linux, web server you're using, environment, and what your actual goal is. We can't guess. |
Here is an answer, but since your question is remarkably vague, I can't tell whether it fits your case: https://www.linux.com/topic/networki...raffic-part-2/
This is how I found this answer: https://www.google.co.jp/search?q=ba...direct+traffic |
TBOne - I hired a programmer from Fiverr. You know the site. He couldn’t do it. I’m looking for url forwarding example. I am not near the Perl scripting phase yet. I want to figure out how some one does it first. Facebook does it and bitly. Is this just a million CNAMES or is there as I suspect much more to it? I know you Can forward names with Apache. I’ve done that. So that’s two ways CNAMES and Apache. There’s also html.
|
Please describe your task again, what you want to actually accomplish -- not how but what.
What kind of traffic do you wish to redirect TCP, UDP, etc? Or are you looking above the networking layer at the application layer, HTTPS, SSH, SIP, RTSP, etc? |
Quote:
Quote:
AGAIN: unless you provide details and answer questions, there is nothing we can do to help you. |
There are numerous different ways to redirect traffic that vary from a single-line of code/config to installing dedicated switch/firewall appliances with fancy management interfaces.
You almost certainly don't need the latter, but it's not possible to say whether your issue can be solved with a single line because you've still not described what your actual issue is. * Do you want all traffic from domain1 sent to domain2 or only some of it? * Does the user need to know they're going to domain2 or does it not matter? * Are both sites hosted on the same server or different servers? * What (if any) server software is installed on the machine hosting domain1? * What level of access/control do you have to that server? etc Changing DNS might be an option, but depends on domain2's servers accepting the request for domain1 - a CNAME is just an alias; it doesn't actually redirect - and of course you need control of the DNS records, and there's the propagation delay (can be 20 minutes, can be 48 hours). Apache has at least four different ways of doing it, depending on the specific needs involved. A HTML meta refresh is a low skill / low effort solution that may well be perfectly good enough for your needs, but you need to say precisely what those are. If the website is written in Perl or Bash then they could generate the meta tag, or a HTTP 3xx response, or even act as a reverse proxy - but only if there are conditions involved (e.g. database lookup) that can't be addressed by the front-end server (i.e. Apache), because there's no need to re-write functionality that already exists and is well tested. |
Quote:
https://httpd.apache.org/docs/2.4/re...remapping.html |
Thank you for the Apache site. I use some of this in my site already. The challenge is to create 1000 sub domains that all resolve. This would be like BITLY.com or Facebook. I’m sure these sites are also registrars. I just have to put my toe in the water if you get what I mean?
|
Quote:
Quote:
If you're not going to answer questions that are asked of you, why bother posting a question??? You've STILL not provided any details, despite being asked numerous times thus far. |
Thank you for caring! How about this. Create a Perl script with a 1000 numbers generated 1 through 1000. Append the host with these numbers in a file. Use Perl cgi to add these to a perlcgi webpage. Generate a 1000 HTML pages with a file label in sequence.
This would work because you could use 1000 of the same page of HTML. Better? |
Quote:
AGAIN, we are NOT going to write your scripts for you, period. You have been given direction and hints. You **STILL** do not answer questions asked or provide any details. You have been told this before: https://www.linuxquestions.org/quest...es-4175676771/ Asking for handouts won't get you far. |
Quote:
How to write a reverse-proxy with Go in 25 minutes This is something the Fiverrr guy should have been able to give you. Unless he was dealing with a common cause of project failure. Which is unclear requirements. ;) Maybe give us a simplified example where you show us two subdomains and a URL, and tell us how how want the redirection to work? |
Alright thank you Dugan. Let’s go again. Maybe the reverse proxy is a better idea. You get a request and generate a blank webpage. You would have to assign page name url and HTML or xml. I liked the GO video. Seemed possible and on demand. I will look for examples. Thank you.
|
Perl pseudo code :
While loop Sed >> list1 Next While List1 > touch > final dir It’s possible in under a page! |
All times are GMT -5. The time now is 03:22 PM. |