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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-30-2004, 05:24 PM   #1
Dcat
Confirmed User
 
Dcat's Avatar
 
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?
Dcat is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-30-2004, 05:25 PM   #2
WiredGuy
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.
WiredGuy is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-30-2004, 05:29 PM   #3
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
A rewrite in your .htaccess should do the trick.
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-30-2004, 05:38 PM   #4
Dcat
Confirmed User
 
Dcat's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: Mexico
Posts: 1,607
Quote:
Originally posted by punkworld
A rewrite in your .htaccess should do the trick.
Thanks, but what exactly do I add to my .htaccess file?
Dcat is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-30-2004, 06:39 PM   #5
Dcat
Confirmed User
 
Dcat's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: Mexico
Posts: 1,607
bump
Dcat is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-31-2004, 09:36 AM   #6
Dcat
Confirmed User
 
Dcat's Avatar
 
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;

---------------------------------------------------

Dcat is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-31-2004, 12:56 PM   #7
raymor
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
raymor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.