404 questune

They have: 4 posts

Joined: Jan 2001

hi all
at last i find a cgi forum and it nice hope it can help me allso

ok im bascly asp vb programer but there is things that vb cant do

what i need is a simple perl script that gets 2 urls
check the fiers if its bad url like if it gets 404 403 ...
redirect automaticly to the second url that good for sure

im using win2000 iis5 that has cgi with perl

is there an easy way doing that in perl

thanks a million to all the perlers

cheers

They have: 850 posts

Joined: Jul 1999

Hello, and welcome to TWF!

I hope I understood your question correctly (and if not, please due tell!).

The following is what I 'think' you are looking for:
http://wiredstart.com/cgi-bin/urlcheckforward.pl

If the first URL is incorrect or brings up an error, than the user will be forwarded to the second URL entered.

The source can be found:
http://wiredstart.com/source/urlcheckforward.txt

The script required a few modules:
CGI.pm and LWP::UserAgent. Your host will hopefully have them both installed.

Hope that helps!

They have: 4 posts

Joined: Jan 2001

thanks man realy
i didnt knew what to do here and i knew it simple
its frastrating i gotta learn perl a little bit

you understood the script
but what i need it a bit difrent

the 2 urls suppose to come from a link

like
test urls

somthing like that like 2 url dont come from a form
they come from direct links

and second ques is it good for win2000 runnig iis5

thanks a milliom man

cheers

They have: 850 posts

Joined: Jul 1999

The script does not need to be edited to do what you need.
http://www.wiredstart.com/cgi-bin/urlcheckforward.pl?url1=http://www.google.com/FAKEURL.html&url2=http://yahoo.com.

To be honest I am not sure if it will work with Windows 2000, but the best thing to do is try it out and see Smiling

The Perl version that I have for Windows from activestate.com has the modules you require installed, so if you have ActivePerl installed on your server, everything should work fine.

Good luck!

They have: 4 posts

Joined: Jan 2001

hi again
and thanks again
as itold you befor basicly im asp vb prog
and its not possible to do that task is asp

so since this script what you sent is perfect
ill try to modefy it a bit

is it possible to change the script so it gets 4
parameters 2 urls and anther 2 then
if url1 is not good it will redirct to url2
then write to a text file
the all 4 parametrs + the date

thanks cheers

iarin
[email protected]

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.