1

I am trying to set up one Magento version 2.4.3-p1 project in my local environment. After setting up project, all pages are redirected to https URL. I have set the following DB entries in the core_config_data table:

  • web/unsecure/base_url, web/secure/base_url, web/unsecure/base_link_url, web/secure/base_link_url = http://local.test.com/
  • web/secure/use_in_frontend = 0
  • web/secure/use_in_adminhtml = 0
  • web/cookie/cookie_domain = NULL
  • web/cookie/cookie_httponly = 0

I have checked both magento_root/.htaccess and magento_root/pub/.htaccess files, but there's nothing found related to https redirection.

Please, anyone, let me know what settings I need to do to stop HTTP to HTTPS redirection. Thanks in anticipation.

1
  • I was facing the same issue during the local setup of M2.4.3-p1 two days back. I've spent a day behind this but found nothing. In my case in incognito browser the url was not redirecting to the https. So I've cleared browser cache,cookies data, cleared site data and for https url empty cache and hard reload and then tried http url. Somehow it worked. I am not sure about the exact issue. Commented Apr 6, 2022 at 4:55

1 Answer 1

0

I too faced this issue long back and the solution is we need to use a different domain for local development. For example, Chrome will automatically redirect from http://*.dev/ URL to https://*.dev/ because of following reasons. I remember I faced this issue when the domain name contains test.com. I used the domain http://magento.default.m243p1/ for local setup and it is working for me.

Easy for your reference:

https://www.chromium.org/hsts/

An HSTS enabled server can include the following header in an HTTPS reply:

Strict-Transport-Security: max-age=16070400; includeSubDomains

When the browser sees this, it will remember, for the given number of seconds, that the current domain should only be contacted over HTTPS. In the future, if the user types http:// or omits the scheme, HTTPS is the default. In fact, all requests for URLs in the current domain will be redirected to HTTPS. (So you have to make sure that you can serve them all!).

https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/ https://stackoverflow.com/questions/47768289/chrome-redirects-dev-to-https https://stackoverflow.com/questions/47735877/how-to-stop-chrome-from-redirecting-to-https https://www.rfc-editor.org/rfc/rfc2606 https://superuser.com/questions/565409/how-to-stop-an-automatic-redirect-from-http-to-https-in-chrome

Another solution, the issue will fix if we enable HTTPS for our local setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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