 |
 |
Redirect URL
|
 |
|
 |
|
Junior Member
Join Date: Oct 2002
Status:
Offline
|
|
Given a HTTP URL I need to get the redirect URL, i. e. what you get from a 30x HTTP error code.
I don't want to download something, just get hold of the "real" URL that a browser would be redirected to.
How could I get this?
(Last edited by manfreds; Nov 7, 2002 at 02:11 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status:
Offline
|
|
Originally posted by manfreds:
Given a HTTP URL I need to get the redirect URL, i. e. what you get from a 30x HTTP error code.
I don't want to download something, just get hold of the "real" URL that a browser would be redirected to.
How could I get this?
If you just look at the HTTP header, you can get the information you want. For instance, try "curl --head www.war.com", and note the "Location: " field in the reply.
|
|
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2002
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status:
Offline
|
|
If you're not trying to automate it, you can do it manually. Open a terminal window and type what's in red below (note TWO return characters after the HOST: line):
% telnet www.schubert-it.com 80
Trying 192.67.198.55...
Connected to iiweb5.webmailer.de.
Escape character is '^]'.
HEAD /download/vektor3.dmg HTTP/1.0
HOST:www.schubert-it.com
HTTP/1.1 200 OK
Date: Thu, 07 Nov 2002 19:13:50 GMT
Server: Apache/1.3.26 (Unix) mod_script
Vary: Host
Last-Modified: Wed, 06 Nov 2002 09:42:57 GMT
ETag: "1279820-44f2d0-3dc8e421"
Accept-Ranges: bytes
Content-Length: 4518608
Content-Type: application/octet-stream
X-Cache: MISS from www.schubert-it.com
Connection: close
Connection closed by foreign host.
However, as you can see, this gives a 200 (OK), not a 302 redirect. If it were a 302, you should see the redirect in the headers. If not, replace the 'HEAD' command with a 'GET' to return the entire page (although it's not a good idea to download a binary file in the manner in a terminal  )
|
|
Gods don't kill people - people with Gods kill people.
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2002
Status:
Offline
|
|
Originally posted by Camelot:
If you're not trying to automate it, you can do it manually.
Automating it was the idea. If it's not moved, then why does hdid give me that error? Here's what it says:
hdid http://www.schubert-it.com/download/vektor3.dmg -verbose
hdid: DILoadDriver: checking for disk image driver
hdid: DILoadDriver: DI_kextExists() returned 0x00000000 (0)
DIBackingStoreInstantiatorProbe: interface 0, score -1000, CBSDBackingStore
DIBackingStoreInstantiatorProbe: interface 1, score 100, CHTTPBackingStore
DIBackingStoreInstantiatorProbe: interface 2, score -1000, CRAMBackingStore
DIBackingStoreInstantiatorProbe: interface 3, score -1000, CCarbonBackingStore
DIBackingStoreInstantiatorProbe: interface 4, score -1000, CDevBackingStore
DIBackingStoreInstantiatorProbe: interface 5, score 200, CCURLBackingStore
DIBackingStoreInstantiatorProbe: selecting CCURLBackingStore
hdid: CCURLBackingStore::statImage() failed - http code 302.
hdid: "http://www.schubert-it.com/download/vektor3.dmg" unrecognized: internal error.
What does that mean?
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2002
Status:
Offline
|
|
Is there anybody who knows this?
|
|
|
| |
|
|
|
 |
|
 |
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2001
Location: State of Denial
Status:
Offline
|
|
|
|
|
[Wevah setPostCount:[Wevah postCount] + 1];
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2002
Status:
Offline
|
|
Originally posted by CharlesS:
Probably www.schubert-it.com is on virtual hosting. I posted an explanation of what causes the problem in this thread.
Sure it is. Thanks for the explanation.
Unfortunately there doesn't seem to be a way to get the "real directory" of the file then. 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|