That answer requires mod_rewrite to be enabled in the (Apache) server installation, probably nothing you can change or install by yourself as it is a shared hosting. I’m not sure how else you can do it with .htaccess but there are alternatives.
You can use PHP or whichever language your hosting supports. From here:
<?php
header("Location: http://subdomain.site.com:8080/"); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
?>
Or you can just put an index.html and do it in Javascript.
Alternatively you can make Syncthing run the GUI at port 80 (though this might not work since the web server would be running at 80 as well) from Actions > Advanced or by changing the config (~/.config/syncthing/config.xml:
With <gui enabled="true" tls="true"> and the service on port 0.0.0.0:80 I wasn’t able to run ./syncthing, this was the output:
[GKBO4] 05:00:56 FATAL: Cannot start GUI: listen tcp 0.0.0.0:80: bind: permission denied
[monitor] 05:00:56 INFO: Syncthing exited: exit status 1
[monitor] 05:00:57 WARNING: 4 restarts in 5.460191436s; not retrying further
I had to set back tls="false" and the service on port 0.0.0.0:8080.
No problem, I will keep it like that, maybe is the shared hosting that that has got some strange setup. Question: is there any security implication with tls="false"?
@Zillode, I have tried but it doesn’t works. God only know why. I cannot investigate further as I’m not root: I’m on a shared hosting. Thank you anyway, the important thing is that Syncthing works fine
@Alex: WOW, wait a second, how is this possible?!
You are blowing my mind, man!
I have setup the .htaccess following your first link and I have then setup the GUI with HTTPS.
…and it worked!
But who is the owner of this certificate?
Who has created this certificate can possibly intercept my traffic, now.
You’re talking about LetsEncrypt? That’s not how it works: certificates are generated on your local machine, then signed by LetsEncrypt. LetsEncrypt never see your private key, and cannot decrypt your data.