Search code examples
phplaravelapachehttpshttp-redirect

Disable Laravel 8 application redirection from http to https deployed on Xampp Apache server


I want to Disable redirecting from http to https in my Laravel 8 application temporarily due to some issues. I've tried the solution of This question but didn't work for me.

I have tried the following solution:

  • Apache server configurations
  • Browser cache clearing
  • php artisan optimize:clear
  • php artisan route:clear
  • .env file
   APP_URL="http://example.com"
   FORCE_HTTPS=false2

Solution

  • I had reverted my Apache server configurations which caused https redirection. But even then, the problem was consistent. Because neither the Apache server nor Laravel were causing problems.

    The problem was actually caused by web browsers. Once the browser stores an SSL certificate, it attaches the certificate to the site by itself sometimes. This was causing redirection from http to https. Browsers were doing this even in incognito mode.

    This answer helped me in resolving my problem.

    So I deleted the domain security policy using the following steps and the browser stopped this behavior.

    1. Type this in browser URL bar
       chrome://net-internals/#hsts
    
    1. Deleted my domain name in the section Delete domain security policies

    enter image description here

    1. Clearing browser data (Cached images and files)
       chrome://settings/clearBrowserData
    

    Clear cached images and files