Page Index Toggle Pages: 1
There are no actions to perform.
Normal Topic Perl redirection to another domain (Read 2,372 times)
The Boy
Full Member
***
Offline



Posts: 385
Location: UK
Perl redirection to another domain
Feb 23rd, 2013 at 2:48pm
There are no actions to perform.
I've had to get my old archived YaBB off my live server, and onto another server hosted at Dreamhost.  This is mostly due to Baidu not obeying robots.txt, and hammering the old YaBB site until it ran out of resources Sad

Anyway, in case it proves useful to others...

YaBB.pl
Code (Perl)
Select All
#!/usr/bin/perl
use strict;
use warnings;
my $url = "http://oldsite.omegaowners.com/forum/YaBB.pl";
my $query_string = $ENV{'QUERY_STRING'};
print "Location: $url?$query_string\n\n";
 


(obviously, shove your own URL in, not mine!)

Although I do wonder if I should change that last line to:
Code (Perl)
Select All
print "Status: 302 MovednLocation: $url?$query_string\n\n"; 




Hope it may be of use to somebody.
  
Back to top
WWW  
IP Logged
 
The Boy
Full Member
***
Offline



Posts: 385
Location: UK
Re: Perl redirection to another domain
Reply #1 - Feb 23rd, 2013 at 2:50pm
There are no actions to perform.
I should add, this has taken my server load down from "worrying" to "idle" - I had a load index of 0.00 0.00 0.00 the other day when I checked. This server now just runs my SMF forum, with MySQL, and the YaBB redirect.
  
Back to top
WWW  
IP Logged
 
Max C Burger
YaBB Newcomer
*
Offline



Posts: 4

None
Re: Perl redirection to another domain
Reply #2 - Jun 2nd, 2016 at 9:52am
There are no actions to perform.
If the question asked for how to use HTTP to redirect, I'd probably think to give the print "Location..." answer but when asked for cgi, even in lowercase, we do tend to think of CGI.pm. Plus, though the print "Loc..." works, it is short on headers. It's fine to do it yourself but doing it right is usually easier through an interface. Even one that is less than ideal. Click herefor more reference

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
There are no actions to perform.