httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krist van Besien" <krist.vanbes...@gmail.com>
Subject Re: [users@httpd] unusual return (permanently migrated)
Date Mon, 10 Nov 2008 21:57:19 GMT
On Sun, Nov 9, 2008 at 1:24 PM, Mohan gupta <mohangupta13@gmail.com> wrote:
> thanks man for replying ...
> actually the program is my one made
> iam trying to make a web crawler so iam using unix socket api's
> as i use
> write(sockfd,"GEt url HTTP 1.1\r\nHost:\r\n\r\n",30);
> and then read it
> read(sockfd,buf,sizeof(buf));
>
> but i dont understand what do u mean by redirect ...i mean when someone
> redirects it gives a nrw url to follow?????
> where do you find that url in the reply if it does so???

When a server responds with an http result code of "302" it is telling
you that the resource you requested really exists at some other urls.
The "Location" header in the response contains the real URL for the
resource. Your crawler should then request this redirect in stead.
Browsers usually do this without the user even noticing it.

However, if you really want to write your own crawler you should start
by reading a bit about the http protocol. There are more result codes
that your program might need to be aware of.

Krist
-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message