403 error on admin login page

I managed to enter the admin page finally! So I added these two lines to wp_admin.php:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

afterward deleted the .htaccess file, then deleted browsing history, cleared cache and cookies. After all of this I could enter the admin page.

Then I went to options/general and options/permalinks and saved the setting, it generated a .htaccess file and now it is working.

I also tried removing the two added lines from wp_admin.php after all, but I broke the page so they are going to stay for a while.