WebFaction
Community site: login faq

Hi,

I'm trying to setup apache to always force https on my site.

My site is places.lifelei.com (a subdomain of lifelei.com of course, which resides on a separate Application).

At the root of places.lifelei.com I've put the following .htaccess:

#.htaccess
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://places.lifelei.com/$1 [R,L]

However this results onto a redirect loop (as reported by Google Chrome) and I don't know why.

Does anyone knows what could be wrong? Or any other way to accomplish the same thing (Force users to always use https) ?

asked 30 Jan '12, 15:35

Alejandro Mo...
316
accept rate: 0%


If you are set up on WebFaction, you should be able to set up a separate website/app for the non-https version, and make it redirect to the https version. That simplifies the .htaccess file to just a single redirect in the new app.

I do this regularly to redirect example.com to www.example.com and vice versa; and just tested redirecting https to http with one of my parked domains (in my case I redirected the https version to the http version, since I didn't want to bring the existing http site down):

  1. Created a PHP application (because PHP applications have Apache/.htaccess) and put just a redirect in it.
  2. Created a web site, checked https, gave it the same domain name as I already was using, and assigned it the new redirect app.

Going to the https version successfully redirected to the http version.

permanent link

answered 30 Jan '12, 15:46

Hoboes
2826
accept rate: 25%

more like a hack than a fix, but it worked like a charm, thank you very much :D

(30 Jan '12, 16:03) Alejandro Mo...
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:

×74
×33
×27

question asked: 30 Jan '12, 15:35

question was seen: 4,953 times

last updated: 30 Jan '12, 16:03

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