Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento2 Backend, gives redirect loop #2473

Closed
santrooper opened this issue Nov 22, 2015 · 10 comments
Closed

Magento2 Backend, gives redirect loop #2473

santrooper opened this issue Nov 22, 2015 · 10 comments

Comments

@santrooper
Copy link

System Details

host :: http://dev.magento_2.nl [Apache Virtual Host]
PHP Version 5.6.15-1+deb.sury.org~trusty+1
System Linux Elsha 3.13.0-68-generic #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015 x86_64
Server API Apache 2.0 Handler
Browser :: Mozilla Firefox for Ubuntu ver 42.0 [All cache enabled]

Issue

Magento2 installed with sample data [full].
Magento2 Frontend, Works fine. [Url :: http://dev.magento_2.nl]
Magento2 Backend, gives redirect loop. [Url :: http://dev.magento_2.nl/mg2admin]

Tried to debug, with following results.

File @ :: "vendor/magento/module-backend/Controller/Adminhtml/Auth/Login.php"

Method :: public function execute()...

Line :: return $this->getRedirect($backendUrl);

causes infianite redirect.

File @ :: "vendor/magento/framework/Controller/Result/Redirect.php"

Method :: public function setPath($path, array $params = [])....

$path = 'http://dev.magento_2.nl/mg2admin/admin/index/index/key/d13fc6c95465f4b9f86eb2734f8aeb985652c2bea2ebacbd39791550536f57e2/';

$params = [];

$this->url = $this->urlBuilder->getUrl($path, $this->redirect->updatePathParams($params));

/*
Returned URL :: http://dev.magento_2.nl/mg2admin/http:/index/dev.magento_2.nl/mg2admin/admin/index/index/key/e667989087990866ee28bb69b7d4d81c05f23964b0da418afd646f2ceff1b49d/
*/

@daim2k5
Copy link
Contributor

daim2k5 commented Nov 22, 2015

Has hopefully nothing todo with your bug but dev.magento_2.nl is not a valid domain name

@santrooper
Copy link
Author

Thanks for the reply,
but "dev.magento_2.nl" is in my desktop dev server
hosts file entry is "127.0.0.1 dev.magento_2.nl",
so, if may I ask what should I do to resolve this.
on further note the same works for magento 1.9 and earlier
[with different url ofcourse, say : dev.magento_1.nl]

@santrooper
Copy link
Author

Ok, Sorry for being a "DUMB A#@".
"dev.magento_2.nl" > "dev.magento2.nl"

@vasilii-b
Copy link

How did you solved this ? I am getting in this trouble too.

@santrooper
Copy link
Author

If you are using apache, in your local DEV env, try to use/configure virtual host entry, also do not forget to make changes to the hosts file, finally test your domain name like
"if (filter_var($_url, FILTER_VALIDATE_URL) === false) {".....
and finally using magento 2 cli do
[magento 2 root]$ sudo php bin/magento setup:upgrade

I hope this will help...

@sintsov
Copy link

sintsov commented Feb 12, 2016

Don't use your domain name symobol _, example site_dev.example.com
because expression filter_var($_url, FILTER_VALIDATE_URL) return false

@sankaran-consultant
Copy link

Its worked thanks @sintsov . you are great

@sintsov
Copy link

sintsov commented May 2, 2016

@sankaran-consultant no problem, friend!

@bratati1989
Copy link

@sintsov , I faced same problem. But your solution works. Thanks a lot.

@mrfroasty
Copy link

Thanks - was really puzzled by this @sidolov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants