Redirects in URL — link juice or not?

Guys, I’m wondering. 
If you have a URL with a redirect, e.g.

or the (old) phpinfo exploits, how could that possibly make google count this as a link?
And if I add a tier to it, would be getting the link juice, not
Or am I wrong? 
I am seriously confused.