Clear net and .onion support

I'm curious to know if anyone has set this up for Xenforo yet.

I'm working on something where I'd like to provide access over Tor (with a .onion URL) but when I've done a little messing around with an onion url, I struggled to stop the connection from redirecting to the clear net url.

I haven't delved to far into it yet, but I thought I should ask before I get to deep in this rabbit hole. Is it possible to set up the same site to work over clear net and .onion?



I am aware you can use Cloudflare for something related to onion routing, but I do mean a full onion url rather than an exit node replacement.
 
Last edited:
This was pretty easy to set up, I just needed to:
  • Mess around with the web server config.
  • Disable Enable board URL canonicalization.
  • Disable Link logo to home page URL
  • Change the xenforo config to handle cookies different for onion urls.
PHP:
$config['cookie']['prefix'] = 'xf_';
$config['cookie']['path'] = '/';
$config['cookie']['samesite'] = 'Lax';

if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) {
    $config['cookie']['domain'] = '';
    $config['cookie']['prefix'] = 'xf_onion_';
} else {
    $config['cookie']['domain'] = '.mydomain.net';
}
 
Back
Top Bottom