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



Posts: 386
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: 386
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
 
Mkonrad
YaBB Newcomer
*
Offline



Posts: 16

None
Re: Perl redirection to another domain
Reply #3 - Aug 31st, 2016 at 8:53am
There are no actions to perform.
I am not sure what you are trying to get answered here? Is it how to redirect? In that case go for a 301 redirect - most online providers allows this from their backend.
  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,452
Location: Earth

YaBB 2.6.1
Re: Perl redirection to another domain
Reply #4 - Aug 31st, 2016 at 1:31pm
There are no actions to perform.
Mkonrad wrote on Aug 31st, 2016 at 8:53am:
I am not sure what you are trying to get answered here? Is it how to redirect? In that case go for a 301 redirect - most online providers allows this from their backend.



There are actually a few servers/hosts that don't offer .htaccess redirects.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
The Boy
Full Member
***
Offline



Posts: 386
Location: UK
Re: Perl redirection to another domain
Reply #5 - Nov 5th, 2016 at 1:01pm
There are no actions to perform.
Dandello wrote on Aug 31st, 2016 at 1:31pm:
There are actually a few servers/hosts that don't offer .htaccess redirects.

Any that don't run Apache really Wink

  
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,452
Location: Earth

YaBB 2.6.1
Re: Perl redirection to another domain
Reply #6 - Nov 5th, 2016 at 10:00pm
There are no actions to perform.
I'm sure there's something for IIS as well. (But don't ask me what it is.)   Cool
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
There are no actions to perform.