Solved

A really simple redirecting question.

Posted on 2000-04-16
4
159 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to dynamically set the form action using jQuery.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

19 Experts available now in Live!

Get 1:1 Help Now