react-https-redirect
react-https-redirect copied to clipboard
Subdomains won't load on localhost
This works great for an app with a single domain, but my subdomains don't load on localhost.
Example foo.localhost:3000
automatically redirects to https://foo.localhost:3000/
and throws an error
Having this same issue
Use the disabled property and use your env variables to dynamically disable this feature :
In the .env
file, when you want to disable the feature, add:
REACT_APP_DISABLED_HTTPS_REDIRECT=true
In your App
:
import React from 'react';
import HttpsRedirect from 'react-https-redirect';
const App = () => (
<HttpsRedirect disabled={process.env.REACT_APP_DISABLED_HTTPS_REDIRECT === 'true'}>
[...]
</HttpsRedirect>
);
export default App;