Solved

redirect encrypted cgi pages

Posted on 2009-05-14
5
241 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
  • 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

708 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

18 Experts available now in Live!

Get 1:1 Help Now