Fix and clarify the logic for local/remote urls.
Fix and clarify the logic for local/remote urls.

Use extra local variables that are easier to read than double-negatives.

ipython/ipython,ipython/ipython