So I went in to DB and changed the core_config_data entries to correct it. Cleared my var/cache in my magento directory. And it kept showing the incorrect url for css,js and images.
When I looked in Admin -> Configuration -> Web the entries were all changed, so it was a caching issue.
I couldn't figure out where it was caching, because I would clear var/cache and then Magento would recreate the cache files in var/cache.
So eventually, I figured out that it was caching on the server at /tmp/magento/var/cache But the weird thing is, that it seems to cache in var/cache and /tmp/magento/var/cache It also seems to be doing this for sessions! And some logs go to /tmp/magento and some to var/log
I have var/cache in my magento directory set to 777
Any ideas why it is splitting the cache? why is going to tmp if I have var/cache set to 777?