Solved

redirect encrypted cgi pages

Posted on 2009-05-14
5
255 Views
Last Modified: 2013-12-25
We are going to switch from cgi pages to php pages. So we want to redirect the google indexed cgi pages to our new pages. We tried .htaccess redirect but it doesn't work with cgi files. Plus our cgi pages are encrypted.

Old page: http://www.mysite.com/cgi-bin/page.cgi?a=info.html&b=2003
New page: http://www.mynewsite.com/2003/

Any suggestions how to get redirecting work for these encrypted pages?
0
Comment
Question by:trailerman
[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
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

by:berseken
ID: 24389136
at the top of your script this would do it:

my $cgi = CGI->new();
my $year = $cgi->param("b");
print $cgi->redirect("http://www.mynewsite.com/$year/");

0
 

Author Comment

by:trailerman
ID: 24390659
the cgi page is encrypted. Is it okay to add the script on top?
0
 
LVL 1

Expert Comment

by:berseken
ID: 24392358
I am not sure what you mean when you say that the cgi page is encrypted. Do you mean that it is accessed via https?

If you edit the script and there is a line at the top that looks like this:
#!/usr/bin/perl

then just put the code I provided on the next line.
0
 

Author Comment

by:trailerman
ID: 24397938
you don't see the regular perl codes on the page but all 'weird' characters because the pages are encrypted.

Is there a way to go around these encrypted pages?

0
 
LVL 1

Accepted Solution

by:
berseken earned 300 total points
ID: 24404264
Actually the easiest way is to just move that 'encrypted' perl script out of the way and replace it with a script which has the same name that contains this:

#!/usr/bin/perl
use CGI;
my $cgi = CGI->new();
my $year = $cgi->param("b");
print $cgi->redirect("http://www.mynewsite.com/$year/");
0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 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