home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2862
Discussions: 188,380, Posts: 2,243,462, Members: 232,607
Old June 3rd, 2002, 11:45 AM   Digg it!   #1 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
Need fast help!

I was wondering of someone could help me write a cgi script that when some one goes to this website, http://ejk.myip.org:88/cgi-bin/ikonboard.cgi
it will automatically re direct them to here:
http://ejk.myip.org:88/phpBB2/index.php
__________________
Got root?

e980238 is offline   Reply With Quote
Old June 3rd, 2002, 12:16 PM     #2 (permalink)
OH NO!
 
Brainchild's Avatar
 
Join Date: Oct 2001
Location: Monett Missouri
Posts: 4,269
Send a message via Yahoo to Brainchild
How about this or maybe This one and the Google
Hope that helps some,
__________________
The impossible takes more time,and costs more money.

Brainchild is offline   Reply With Quote
Old June 3rd, 2002, 12:36 PM     #3 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
ok i got a redirect script but i am still having trouble. this is the scrips:
#!/usr/bin/perl
################################################## ####################
# Redirect URL Version 1.0 #
# Copyright 1999 Frederic TYNDIUK (FTLS) All Rights Reserved. #
# E-Mail: tyndiuk@ftls.org Script License: GPL #
# Created 05/30/99 Last Modified 05/30/99 #
# Scripts Archive at: http://www.ftls.org/cgi/ #
################################################## ####################
# Function : #
# Redirect visitor to another URL #
# Use it : redirect.cgi?URL #
# URL = http://www.webdom.com/page/ #
################################################## ####################
##################### license & copyright header #####################
# #
# Copyright (c) 1999 TYNDIUK Frederic #
# #
# This program is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public License as #
# published by the Free Software Foundation; either version 2 of #
# the License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program in the file 'COPYING'; if not, write to #
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, #
# Boston, MA 02111-1307, USA, or contact the author: #
# #
# TYNDIUK Frederic <tyndiuk@ftls.org> #
# <http://www.ftls.org/> #
# #
################### end license & copyright header ###################
################################################## ####################
# Necessary Variables: #
# The following variables should be set to define the locations #
# and URLs of various files, as explained in the documentation. #

#Options:
$UseLog = 0; # Use Log File ? 1 = YES; 0 = NO
$LogFile = "/Absolute/path/to/log.txt";

# Nothing Below this line needs to be altered! #
################################################## ####################

@date = localtime(time); $date[4]++;
$Time = "$date[4]/$date[3]/$date[5]";

$Query_File = $ENV{QUERY_STRING};
$Query_File =~ s/%([0-9A-F][0-9A-F])/pack("C",oct("0x$1"))/ge;
$Query_File =~ tr/+/ /;
($url) = split(/\&/,$Query_File);

if ($url =~ /=/) {
($name, $url) = split(/=/, $url);
}

if ($UseLog) {
open(LOG,">>$LogFile") || &Error("Cannot Write Log File : $LogFile, Error $!\n");
print LOG "[$Time] - $ENV{'REMOTE_HOST'} -> $url\n";
close(LOG);
}

if ($url =~ /^(ht|f)tp:\/\//) {
print "Location: $url\n\n";
} else {
&Error("Your URL sould be begining by http:// or ftp://\n");
}

sub Error {
my($ErrorText) = @_;
print "Content-type: text/html\n\n";
print "Error: ".$ErrorText;
exit;
}




but where do i put in the url to redirect to??

e980238 is offline   Reply With Quote
Old June 3rd, 2002, 02:10 PM     #4 (permalink)
Ultimate Member
 
Praetorian's Avatar
 
Join Date: Oct 2001
Location: Arizona
Posts: 2,538
How about creating a .htaccess file?
Quote:
Redirect /ikonboard.cgi http://ejk.myip.org:88/phpBB2/index.php
Put that inside a file called .htaccess and upload it to the directory. Give it a shot then.
Praetorian is offline   Reply With Quote
Old June 3rd, 2002, 03:56 PM     #5 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
nah that didnt work
e980238 is offline   Reply With Quote
Old June 3rd, 2002, 04:02 PM     #6 (permalink)
Ultimate Member
 
Praetorian's Avatar
 
Join Date: Oct 2001
Location: Arizona
Posts: 2,538
And you're putting that inside the directory that has ikonboard.cgi?
Praetorian is offline   Reply With Quote
Old June 3rd, 2002, 04:10 PM     #7 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
yes
e980238 is offline   Reply With Quote
Old June 3rd, 2002, 04:36 PM     #8 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
is there any way that I can just edit the ikonboard.cgi file to display a message and a link to the new url?
e980238 is offline   Reply With Quote
Old June 3rd, 2002, 05:16 PM     #9 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
ok i got it This script seemed to work for me:
#!/usr/bin/perl

################################################## ########################################
#Redirect 1.01 -- December 14, 1996
#
#Written by Bernard Sowa <bernard@zonecoaster.com>
#
#$default
# Location to redirect user to if no URL is given
################################################## ########################################

$default='http://ejk.myip.org:88/phpBB2/index.php';

($other,$url) = split(/=/,$ENV{'QUERY_STRING'});

if($url =~ /\&x/)
{
$url =~ s/\&x//g;
}

if($url ne "")
{
$url =~ s/\+/ /g;
$url =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$url =~ s/~!/ ~!/g;
$url =~ s/\%2F/\//g;
}
else
{
$url=$default;
}
print "Location: $url\n\n";
exit 0;
e980238 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (2885)
The United States Debt (20)
Looks like Burris will get his Sena.. (8)
I think I just killed my computer w.. (24)
Upgrading RAM (5)
Folderchat Weekday thread (439)
Antec 300 bulk purchase? (11)
Worth the upgrade?? (14)
Help with an Ati Radeon HD 4850 512.. (25)
Recent Discussions
Best digital camera for under 2.. (14)
Help with an Ati Radeon HD 4850.. (25)
Install Problem for Windows Def.. (0)
New Build ( Finally ) (1)
dual monitors wont boot (0)
Folderchat Weekday thread (439)
MSN Hotmail Down??? (7)
Laptop waking up itself (0)
CPU wont boot (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 08:40 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28