It's not easy.
It's not impossible, but it's pretty darn hard. These are the ways you can do a redirection:
Header Redirection.
This is where you ask for "gimmiemypage.php" and instead of sending "200 - OK" as the status, it sends a "30? - Redirected" header (Where ? is 1 or 2). This is really easy to detect, because curl will tell you. Hurrah.
HTML Refresh Redirection.
This is where you use a and one second after parsing that, the browser forwards you onwards.
This is harder to detect because you have to specifically look for meta headers, so you'll need to parse arbitary HTML (Do Not Use Regexes for this, That Would Be Bad) to find those tags. They should always be in , but those wacky karazee webdevelopers might hide them.
Then there are Javascript redirects. Finding these without evaluating the javascript to see what happens is almost impossible. There are various different ways you can redirect people in JS, but you could catch those with a parser. However, because this is JS, you'll end up needing to read and evaluate all the JS you can see on the page, and the included JS, and anything that includes...
My advice is to try and find a way that doesn't mean you need to know about all redirects, because it's a very deep well to fall into.