WebFaction
Community site: login faq

Hello people,

I have a django app+site that uses daphne to handle websocket connections at

wss://example.com/some/path/

Everything else is apache + wsgi. This works fine, but I would like to use a bare subdomain that would redirect the connection to the above address, e.g.:

ws://subdomain.example.com -> wss://example.com/some/path/

I am already using .htaccess in a static app for redirection purposes, with things like:

RewriteEngine on  
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]  
RewriteRule ^(.*)$ https://example.com/www/$1 [R=301,L]  
RewriteCond %{HTTP_HOST} ^subdomain1.example.com$ [NC]  
RewriteRule ^(.*)$ https://example.com/subdomain1/$1 [R=301,L]

Basically, I would like to know the proper way to achieve this:

RewriteCond %{HTTP_HOST} ^subdomain2.example.com$ [NC]  
RewriteRule ^(.*)$ wss://example.com/some/path/ [R=301,L]

Any help is much appreciated...

asked 18 May, 12:02

tari
3113
accept rate: 0%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×76
×76
×5
×1

question asked: 18 May, 12:02

question was seen: 263 times

last updated: 18 May, 12:02

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM