kern / filepizza

:pizza: Peer-to-peer file transfers in your browser
https://file.pizza
Other
4.39k stars 332 forks source link

.htaccess RewriteRule fails #28

Open tristan-k opened 9 years ago

tristan-k commented 9 years ago

I'm using a shared-hoster which only allows ports between 61000 and 65535. For this reasons I want to redirect the port to the subdomain files.tristank.de. Normally this works great but for filepizza it just keeps downloading the index page as a file named download as soon as I browse to files.tristank.de. Accessing filepizza directly with tristank.de:65150 does work. Any suggestions?

.htaccess

RewriteEngine On
RewriteRule ^(.*) http://localhost:65150/$1 [P]

$ curl -sL 'http://fp.tristank.de'

`<!DOCTYPE html>

FilePizza - Your files, delivered.
up

FilePizza

Free peer-to-peer file transfers in your browser.

We never store anything. Files only served fresh.

`
tristan-k commented 8 years ago

Still having trouble with this.

tristan-k commented 8 years ago

Anyone?

kern commented 8 years ago

@tristan-k You might need to set the content-type to text/html for the rewrite rule.

tristan-k commented 8 years ago

@kern Thanks! How do I do that? I followed an answer on stackoverflow, but it still downloads a file called download. Any advice?

.htaccess

RewriteEngine On
RewriteCond %{HTTP:Accept} text/html [NC]
RewriteRule ^(.*) http://localhost:65150/$1 [P]
jnodev commented 7 years ago

@tristan-k Since I am facing the same problem: did you ever resolved that issue?

tristan-k commented 7 years ago

@jan0e No I did not. I gave up.

kern commented 7 years ago

I'm planning a full rewrite of this project fixing the WebTorrent connectivity issues, simplifying serving (which should hopefully fix this issue), using redux, and having an optional encryption password to prevent server operators from tapping into download streams. Will keep this thread updated with progress, especially on the serving component!