For some unclear reason, WordPress allows you to change the site's url, which after being done renders the site inaccessible and unloginable.
That's what happened to me. I changed those values in the general settings page, and afterward the site redirected to the "new" url, and whenever I logged in, the login page took me back to login again, with no message or clue to what happened.
Sure, I could change the siteurl field in wp-options table in the database, but I had no access to it, no phpmyadmin at my disposal, and not to mention any decent database directory permissions...
Well, after hours of trying to reupload the backup database I prepared before starting to work (it didn't help, permissions again), defining siteurl in wp-config.phpand other tips I got on other help pages, I finally found something that worked:
Adding the lines:
update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');
to the beginning of functions.php did the job for me. I got it on http://codex.wordpress.org/Changing_The_Site_URL, though many other tricks from that page didn't help.
I wasted so much precious time on this silly "feature" of the WordPress back-end, so I decided to share. Hope it will help someone.
Webleo