0

On a fresh Magento 2 Open Source install, I accidentally named the site "foo.locale" instead of "foo.local". I've updated the database with the correct value [1] but when accessing the homepage foo.local I am still getting redirected to foo.locale with a parameter:

$ curl -I http://foo.local
HTTP/1.1 302 Found
Location: http://foo.locale/?SID=ltpekiq86h9nltd5rhgdeaidav

I have used mysqldump to confirm that the string foo.locale is not found anywhere in the database, and I've used grep to confirm that the string is not found in any files either.

Where is the redirect happening, and how can I prevent it?

[1] Changing "foo.locale" to "foo.local" in the database:

MariaDB> update core_config_data set value='http://foo.local/' where value='http://foo.locale/';
Query OK, 1 row affected (0.07 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB> update core_config_data set value='https://foo.local/' where value='https://foo.locale/';
Query OK, 1 row affected (0.07 sec)
Rows matched: 1  Changed: 1  Warnings: 0
  • 1
    have you cleared cache, after update? – Technocracker Sep 30 '19 at 17:38
  • Thank you, that worked! I would still like to know where this information was stored, though, if not in the database nor in the files. – dotancohen Sep 30 '19 at 17:52
  • 1
    It stored in magento cache: var/cache directory. – Technocracker Sep 30 '19 at 18:05
  • Thank you Jignesh! – dotancohen Sep 30 '19 at 18:06
1

Please try to clear the cache.

You can clear cache using admin:

> System > Cache Management

Also, You can use command to clear cache:

  • Open the terminal and run below command:

php bin/magento c:f && php bin/magento c:c

If it helps you, please accept it as a solution.

| improve this answer | |
  • Thank you Jignesh. The CLI commands worked. – dotancohen Sep 30 '19 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.