![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Aug 2003
Location: Mexico
Posts: 1,607
|
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? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Pounding Googlebot
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,482
|
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
__________________
I play with Google. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
A rewrite in your .htaccess should do the trick.
__________________
/(bb|[^b]{2})/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Industry Role:
Join Date: Aug 2003
Location: Mexico
Posts: 1,607
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Aug 2003
Location: Mexico
Posts: 1,607
|
bump
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Aug 2003
Location: Mexico
Posts: 1,607
|
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; --------------------------------------------------- ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Oct 2002
Posts: 3,745
|
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
__________________
For historical display only. This information is not current: support@bettercgi.com ICQ 7208627 Strongbox - The next generation in site security Throttlebox - The next generation in bandwidth control Clonebox - Backup and disaster recovery on steroids |
![]() |
![]() ![]() ![]() ![]() ![]() |