• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

redirect script !

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
aja101498
Asked:
aja101498
1 Solution
 
metoCommented:
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
 
dorwardCommented:
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
 
markhoyCommented:
redirect("newpage.pl");


sub redirect
{
     my ($url) = @_;
     print "Location:$url\n\n";
}
0
 
shirjeelCommented:
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
 
sonic63Commented:
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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now