I changed the secure options on Configuration -> Web 'use secure in frontend' and 'use secure in adminhtml' to 'yes' but it was not configurated yet. I cannot access the admin pannel from a browser because it redirects automatically to a https.
I tried to change via database with the commands:
UPDATE core_config_data
SET value=0
WHERE path='web/secure/use_in_frontend' OR path='web/secure/use_in_adminhtml' OR path='web/url/redirect_to_base';
And deleted the var/cache but nothing happens.
EDIT:
SELECT * FROM
core_config_dataWHERE path LIKE 'web/secure/use_in_frontend';
+-----------+---------+----------+----------------------------+-------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+----------------------------+-------+
| 327 | default | 0 | web/secure/use_in_frontend | 0 |
+-----------+---------+----------+----------------------------+-------+
1 row in set (0.00 sec)
SELECT * FROM
core_config_dataWHERE path LIKE 'web/secure/use_in_adminhtml';
+-----------+---------+----------+-----------------------------+-------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+-----------------------------+-------+
| 328 | default | 0 | web/secure/use_in_adminhtml | 0 |
+-----------+---------+----------+-----------------------------+-------+
1 row in set (0.00 sec)
But nothing had changed.
EDIT 2:
Some pages have a strange redirection pattern. For example: http://www.mywebstore.com/customer/account/login/
sends me back to http://www.mywebstore.com/
.
But http://mywebstore.com/customer/account/login/
goes to https://mywebstore.com/customer/account/login/
witch is a 'Not possible to access this webpage' page.
Best Answer
Open your core_config_data table in phpMyAdmin.
Find the row with the path web/secure/use_in_adminhtml and change its value field from 1 to 0 to enable accessing admin panel from unsecure http://www.yourwebsite.com/admin url
Changing web/secure/use_in_frontend toggles customer shopping cart security, 1=on and 0=off which probably isn't of importance as you're trying to regain administrative access
NOTE: Be aware that accidentally entering your leading https:// instead of http:// on your unsecure_base_url before you have enabled TLS/SSL on your webserver will lock you out, so if the above doesn't get you in, look for rows with web/unsecure/base_url and check for the aforementioned misconfiguration
EDIT:
After doing all these things I still couldn't be able to access the admin pannel or any http page without redirecting to https page. So I did a backup from my database (via ssh) and from the folders and created another image from the website. When I moved everything from the old one to the new website, everything worked fine.
So... I really don't know what I did that really solved the problem, but I know one thing: Do regular backups.