Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   Redirect web page in Pearl (.pl) (https://thetfp.com/tfp/tilted-technology/49667-redirect-web-page-pearl-pl.html)

Sexodus 03-19-2004 09:18 PM

Redirect web page in Pearl (.pl)
 
ok this is link
http://www.sotg.us/board/cgi-bin/yabb/YaBB.pl
However i have installed new boards into
http://www.sotg.us/chat/cgi-bin/yabb/YaBB.pl
Old is Board
New is Chat
ok simple? LOL

what i want to do is make it so if people go the board link (like in favorites or something) it redirects them to the Chat folder

There should be some simple code i can copy into a new text.doc and save it as YaBB.pl to work rght? Please show me the way.

Thanks
Sx

P.S. Bill O'Rights
Thanks for the help a while back even though you wernt able to! what had happend was he changed the CHMOD on all the folders in the site!

ni42 03-19-2004 11:52 PM

ya very easy
Code:

#!/usr/bin/perl
use CGI;
$query = new CGI;
print $query->redirect('http://www.sotg.us/chat/cgi-bin/yabb/YaBB.pl');

make shure that you change the path to perl.

Sexodus 03-20-2004 08:33 PM

when you say make sure i change the path to perl, are you talking about the:
#!.. part or something else?

BTW Thanks.

P.S. I copyed and pasted that into a new Text. Then saved it as YaBB.pl and uploaded it. However it didnt take!

Pragma 03-20-2004 10:12 PM

Make sure you mark it as executable (chmod a+x filename.pl) so that it knows that it's not plain text.

And yes, the path to perl is the shebang (#!) portion. If, for example, your server's perl binary is located in:
/usr/local/bin/perl
Then the first line of your perl script must be:
#!/usr/local/bin/perl

ni42 03-21-2004 03:28 AM

what pragma said is absoultly corect. if you are having problems finding your path to perl. have alook at some of your other perl scripts, and just copy the path to perl from them. just upload it like you would any other perl script.

Sexodus 03-21-2004 03:44 PM

Ok cool, thats what i thought, Just wanted to make sure!

Chmod 755 correct?

Again thanks guys!

EDIT: CHMOD 755 and it isnt working,

ni42 03-21-2004 09:39 PM

1. did you change your path to perl?
2. that chmod should work.

if you could post the error msg, there might be something else that could be done.

Sexodus 03-21-2004 09:59 PM

Yes i did check the path. it is the same as other working perl on the site

the error msg is 404

ni42 03-22-2004 11:30 PM

404 means that the file can not be found.
now the question is if it means the perl script or the file the perl script is redirecting to. if you have access to the web server logs you should be able to tell that. if it is the first case, check that you put the perl script in the place that you thought you put it in and check the url you are typing in to get to the test perl script. if it is the 2ed, check the url in the perl script to make shure it is redirecting to the right place. other then that i can not think of anything other that might be wrong.

ratbastid 03-24-2004 04:05 PM

Oh geez. Let's not bring in the multi-thousand-line CGI.pm module for what's fundamentally a one-liner. I mean, I know this thing'll be run once every blue moon or so, but I object to the code above for purely aesthetic reasons.

Once you get your 404 issues solved, recode it to be:

Code:

#!/usr/local/bin/perl

print "Location: http://www.sotg.us/chat/cgi-bin/yabb/YaBB.pl\n\n";

Also, be sure you FTP'ed it to your server in ASCII mode. Sending it in BINARY mode will break it.

Sexodus 03-24-2004 04:42 PM

Thanks it is now fixed! i worked on it and i think it was the ASCII. I was uploading in Auto!

Thanks it is now fixed!
AGAIN Thank you ni42, ratbastid, and pragma!

ni42 03-25-2004 01:39 AM

yes, but CGI.pm outputs the corect status codes.
Code:

Status: 302 Moved
Location: http://www.sotg.us/chat/cgi-bin/yabb/YaBB.pl

whereas the second exg gives TMTOWTDI at its prime. oh and dont mind me i am just being padantic.

Sexodus 03-25-2004 02:07 PM

why do simple things allways turn out o be funny? LOL


Thanks again guys!


...LOL


All times are GMT -8. The time now is 10:14 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project


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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73