Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

redirect encrypted cgi pages

Posted on 2009-05-14
5
Medium Priority
?
257 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 900 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 To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

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

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

715 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