?
Solved

redirect script !

Posted on 2003-03-03
5
Medium Priority
?
267 Views
Last Modified: 2013-12-25
Hi

I need to redirect from one url to another but I don't want to display a message like:

If you are not redirected to the new page within 15 seconds, then please click here.


I have come across something like immediately as you type the url and hit enter the url chages to the redirected url. Is this still called redirect script? where to find such scripts please.

Thanks

aja

0
Comment
Question by:aja101498
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Accepted Solution

by:
meto earned 300 total points
ID: 8058433
You do not need to use cgi script, the easiest way is to put the redirected into the html header of the page that  you do not what the visitor to see.

See below. Use the html below for the page. Change www.sitetogoto.com as required.


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.sitetogoto.com">
</head>
</body>
</html>




0
 
LVL 17

Expert Comment

by:dorward
ID: 8059043
This job _should_ be performed on the server. Client side redirects are not too well liked by search engines, and <meta> refresh doesn't have as much support as http. As a bonus with http you can tell the client requesting the page that it is a permanent move (which is quite useful for search engine indexing bots).

http://www.cgi-interactive.co.uk/apache_redirect_directive.html
http://www.apacheref.com/ref/mod_alias/Redirect.html
http://www.cgi-resources.com/Programs_and_Scripts/Perl/Redirection/URL_Based/
0
 
LVL 7

Expert Comment

by:markhoy
ID: 8063223
redirect("newpage.pl");


sub redirect
{
     my ($url) = @_;
     print "Location:$url\n\n";
}
0
 
LVL 2

Expert Comment

by:shirjeel
ID: 8063570
pls see this link

http://aspn.activestate.com/ASPN/Products/ActivePerl-5.6/lib/CGI.html#generating%20a%20redirection%20header


you ll come to know how to redirect a page.

Shirjeel
0
 

Expert Comment

by:sonic63
ID: 8081361
Here's the CGI equivalent of a HTML/JavaScript redirect page without any prompts (2 lines of code):

#!/usr/bin/perl

print "Location: http://www.test.com/cgi-bin/cgiredirect.pl\n\n";

Simply copy the above two lines into your text editor, replace the destination URL of your choice, and save it as the file name of cgiredirect.pl. Also, make sure the first line of the script, #!/usr/bin/perl, is the correct path to the Perl interpreter on your server. In some cases, it is #!/usr/local/bin/perl instead.

Be sure to CHMOD to 755
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
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…
Suggested Courses

765 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