Panel pages built with wrong domain name

On a working site I just tried to redirect via htaccess from example.com to www.example.com. And now when I try to log in to the panel, the login page is still built with example.com-links, which seems to make logging in impossible.

I already emptied the site/cachefolder and also turned off caching, with no effect, which makes sense. But I can’t find how I can get the panel pages to be built with the www.

See this thread

Thanks!
The thread wasn’t exactly what my problem was. But it gave my the idea to set the sites url with
c::set('url','http://www.example.com');

Problem solved.