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

How can I prevent this automatic redirection from HTTP to HTTPS? #594

Open
jon9090 opened this issue Jun 24, 2024 · 1 comment
Open

How can I prevent this automatic redirection from HTTP to HTTPS? #594

jon9090 opened this issue Jun 24, 2024 · 1 comment

Comments

@jon9090
Copy link

jon9090 commented Jun 24, 2024

To generate a certificate for localhost, I ran the following commands:

brew install mkcert
mkcert --install
mkcert localhost

This created the .crt and .key files, which I then used in my applications (https://localhost:4300).

However, I've noticed that when I open an application that doesn't require HTTPS, it automatically redirects to HTTPS (http://localhost:4200).

How can I prevent this automatic redirection from HTTP to HTTPS?

@andrewcrook
Copy link

Its not the certificate

This redirect could be because of several things.

  1. some web and proxy servers have rules to redirect http to https e.g apache has .htaccess url files
  2. web browsers have started to have a builtin features to redirect http to https you can disable in the browser's config.
    however, the browser normally checks if the https version of the site exists if not, it stays with the http version of the site.
  3. some browser plugins/extensions offer the same feature as no 2
  4. if developing software it is possible that some libraries or project code can also redirect.

so it could be one or more of these. It current sounds like 1 or 4
Its also depend on what you are using in your dev environment.

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

2 participants