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.

link|improve this question

feedback

1 Answer

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"
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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