WebFaction
Community site: login faq

I have read:
http://docs.webfaction.com/software/static.html?highlight=http%20to%20https#redirecting-from-http-to-https

I have try to add:

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

In .htaccess and also in ../apache2/conf/httpd.conf.
But it does not work.

What need to be done for Django site ?

This question is marked "community wiki".

asked 03 Jan '14, 23:21

WebOrCode
5127
accept rate: 0%

Here is a snippet that will work inside your httpd.conf, if you'd rather not create an extra static app:

RewriteEngine On RewriteCond expr "! %{X-Forwarded-Proto} -strmatch 'https'" RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

(12 Apr '14, 21:10) yulian

The following will work in your httpd.conf if you'd rather not create an extra static app:

RewriteEngine On RewriteCond expr "! %{X-Forwarded-Proto} -strmatch 'https'" RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

(12 Apr '14, 21:11) yulian

The method in that document works for any kind of site, because the documentation states that a new website needs to be created in the control panel which is of type Static/CGI/PHP which handles the incoming HTTP requests and contains the .htaccess file. It then forwards the requests on to the HTTPS site specified in the rule.

permanent link

answered 04 Jan '14, 02:06

waynek
4254
accept rate: 27%

I believe that this is a duplicate of this related question. Hope that helps!

permanent link

answered 04 Jan '14, 02:06

ryans ♦♦
5.0k93260
accept rate: 43%

I needed to create new HTTP website with same domain with Static and Static/CGI/PHP-5.4.
And then add .htaccess to that website.

I found solution in:
http://community.webfaction.com/questions/512/how-do-i-set-up-a-https-ssl-django-site

Hope that it will help to someone in future.

permanent link

answered 04 Jan '14, 04:13

WebOrCode
5127
accept rate: 0%

I believe it is a duplicate of another topic.

permanent link

answered 09 Jan '14, 16:29

min0taur
112
accept rate: 0%

edited 09 Jan '14, 16:30

Here is a snippet that will work in your httpd.conf file, if you'd rather not create an extra static app:

RewriteEngine On
RewriteCond expr "! %{X-Forwarded-Proto} -strmatch 'https'"
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
permanent link

answered 12 Apr '14, 21:13

yulian
27214
accept rate: 24%

Your answer
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
×74

question asked: 03 Jan '14, 23:21

question was seen: 7,007 times

last updated: 12 Apr '14, 21:13

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