Until now, there hasn’t been a standard method to discover a website’s Onion site from the main website. That changed with the new release of Tor Browser version 9.5. It introduced a new Onion-Location HTTP response header. Websites can include this response header and have it include a link to the Onion site. The header should including the Onion site origin, plus the same path and query parameter as the current request.
The Tor Browser will display a “.onion available” button ( purple button ) in the address field for encrypted websites (HTTPS) that includes the new header. Clicking it will redirect the user to the same webpage on the Onion site