Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am testing redirects using curl on my localhost. When I run this command:

$curl "test.test.com/landing/0192"

I get this output:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://redirect.redirect.com/landing?xid=0192&amp;tt=192">here</a>.</p>
<hr>
<address>Apache/2.2.17 (Fedora) Server at spencervm.adverplex.com Port 80</address>
</body></html>

Now if I run http://redirect.redirect.com/landing?xid=0192&amp;tt=192" I get to me desired destination. So basically all I want to do is turn off the 302 error and redirect to the page it is supposed to redirect to.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

curl doesn't follow redirects by default, but this isn't your web server's problem; HTTP clients are responsible for implementing handling of redirect responses.

Add the -L flag:

curl -L "test.test.com/landing/0192"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.