0
How to redirect to a given URL from the browser the user is using?
I have a SSL problem that occurs only in Firefox, hence I would like to do the following: when accessing the site https://
, detect the user’s browser and if it is Firefox redirect to the site http://
.
In principle, it should not be done (unless you have a very special reason for it, of course). It would be nice to add to the question the relevant details and what problem you are trying to solve, to make it clear that it is not a XY problem and ensure that the answers give the result you expect. The way the question is, the answers can give more problems than the solution.
– Bacco
Well, basically it would be by the user-agent, but it is easily manipulated by the user, you will have no guarantee that a user is actually using such a browser. What you want can be done by PHP or HTACCESS, but evaluate if it’s really worth it.
– Papa Charlie
Did you ever research the Firefox SSL problem? Type: http://stackoverflow.com/questions/tagged/ssl+firefox
– brasofilo
Now the question is even more interesting, because how will you redirect to avoid the error? SSL negotiation happens before your PHP or even . htaccess is called, so the error will happen anyway. The sequence goes something like this: When you type
https://exemplo.com
Browser grabs the FQDNexemplo.com
and does an IP search for DNS. This done by being a protocolhttps://
, connects by IP on port 443. Then happens the negotiation of SSL, (and your error). After that all is done the requestGET /
, which gives the path, and the HOST header, when the case.– Bacco
@Papacharlie Ok.
– the flash
@brasofilo yes I had already researched here in stackoverflow respect, I thank for the suggestion.
– the flash
@Bacco what happens is that the site is not using redirection by php or . htaccess to https:// if I access the site via https:// it works, just as it will also work by accessing via http://
– the flash