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 04:47 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, 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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360