WebFaction
Community site: login faq

I've read about using a separate static app with .htaccess to redirect non-www to www. I have actually done this and its working fine.

However i would also like to redirect the admin section (e.g. /admin) of the site to https automatically.

Can i do this somehow with .htaccess or how would i do it within a rails controller?

Thanks!

asked 03 Mar '11, 19:25

axelnormand
111
accept rate: 0%


Hi,

You can do it in your routes.rb if you are using Rails 3.

It is explained in greater detail here:

http://stackoverflow.com/questions/3634100/rails-3-ssl-deprecation/3635419#3635419

Hope that helps!

permanent link

answered 03 Mar '11, 20:02

neeravk
1.5k3412
accept rate: 41%

Thanks very much for the reply. I'm actually using Rails 2 (via the Radiant CMS)

But i'm sure something similar is possible in rails 2.

(09 Mar '11, 05:40) axelnormand
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:

×107
×92
×72

question asked: 03 Mar '11, 19:25

question was seen: 2,685 times

last updated: 09 Mar '11, 05:40

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 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