Solved

A really simple redirecting question.

Posted on 2000-04-16
4
161 Views
Last Modified: 2013-12-25
I'm excruciatingly new to the world of cgi (literally a few days), and up to now I can only use other peoples scripts on my site (i.e. I haven't looked into writing them yet!).
Anyway, if you wouldn't mind, I'd like someone to write me a script that makes the browser go to another url. The problem arises because I'm changing over to another host, and I know people are currently linking to the old address. The only two possible old addresses (that no longer work) are:
http://www.jokecity.webprovider.com/ubb/ubbcgi/Ultimate.cgi
and
http://www.jokecity.webprovider.com/ubb/ubbcgi/Ultimate.cgi?action=intro

Coincidently, these two different things have exactly the same effect!
I'd like a script written that I can call Ultimate.cgi, and place in this location that redirects the user to:
http://the-jokecity.virtualave.com/ubb/ubbcgi/Ultimate.cgi

So, I presume you understand the predicament I'm in, and I'll dish out the points for any speedy response that actually works!
(Just for reference, the path for perl is usr/local/bin/perl)
0
Comment
Question by:stesherlock
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
lambda earned 25 total points
ID: 2722233
#!/usr/local/bin/perl

print "Content-type: text/html\n";
$location="http://the-jokecity.virtualave.com/ubb/ubbcgi/Ultimate.cgi";
print "Location: $location\n\n";


This script will redirect user to http://the-jokecity.virtualave.com/ubb/ubbcgi/Ultimate.cgi 

£.
0
 
LVL 1

Expert Comment

by:lambda
ID: 2722262
Another option is giving in the head portion of the HTML,

<meta http-equiv=refresh content=0;url="http://the-jokecity.virtualave.com/ubb/ubbcgi/Ultimate.cgi">
0
 

Author Comment

by:stesherlock
ID: 2724828
Thanks mate! It was just what I was looking for. I'm sorry I asked you instead of just researching it myself, but like I said I'm new to cgi and I don't really have the time at the moment to research it!
If you know of any good, free tutorials I'd be greatly appreciative.
0
 
LVL 1

Expert Comment

by:lambda
ID: 2725285
You can visit the following sites...

http://www.cgi101.com/class/
http://www.irt.org

£.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now