Solved

redirect encrypted cgi pages

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Transform normalized CSV to line in powershell 7 50
Renaming with batch file 9 79
troubleshoot a python script 8 75
Merging text files strings with filename 18 45
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 …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

733 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