![]() |
Perl / CGI Question ..
Can you help me out?
I'm replacing a Top Sites script on my server from ?Top Sites Pro? (Coded in Perl) to ?Auto Rank PHP? (Coded in PHP), and I need to know how to redirect all existing incoming links to the new script. The old (incoming) links look like: http://www.site.com/cgi-bin/topsites.cgi?accountx New site links need to look like: http://www.site.com/in.php?id=accountx I need to know what code to put into the "topsites.cgi" file to make the old accounts redirect to the new link. How would I do this? |
You could create a permanent redirect at the server (apache) level to do this for you so no change need to be made to scripts or existing partners.
WG |
A rewrite in your .htaccess should do the trick.
|
Quote:
|
bump
|
In case anyone else was interested in how to do this, I came up with this code. It performs the account substitution nicely, and seems to work well.
* Note: I placed this code into my old "topsites.cgi" file. --------------------------------------------------- #!/usr/bin/perl use CGI qw(:standard); my $id = param('id'); print "Location: http://www.mysite.com/in.php?id=$id\n\n"; print ("Content-type: text/html\n\n"); exit; --------------------------------------------------- :thumbsup |
This is untested "air code".
$25 will have it installed and tested on your server. RewriteEngine On RewriteRule /cgi-bin/topsites.cgi?(.*) /in.php?id=$1 |
All times are GMT -7. The time now is 12:38 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123