iptables: Packets about generated locally and heading to local

Solution 1:

Nope, the locally originated packets don't pass the PREROUTING chains (see this wiki diagram - the path of local packets starts at the local process block). Also, these packets pass only the INPUT/OUTPUT chains and never the FORWARD.

To redirect the local originated packets you should insert the DNAT/REDIRECT rule into the nat/OUTPUT chain:

iptables -t nat -A OUTPUT -p tcp --dst xxx.yyy.zzz.www --dport 80 \
  -j DNAT --to-destination 127.0.0.1