# Redirect http to https

**URL:** <https://www.ruby-forum.com/t/redirect-http-to-https/171037>\
**Category:** Rails\
**Created:** [June 25, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/redirect-http-to-https/171037 "2009-06-25T16:33:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![parki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@parki](https://www.ruby-forum.com/u/parki)\
**Post date:** [June 25, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/redirect-http-to-https/171037/1 "2009-06-25T16:33:57Z")

</div>

We are runnning Rails 2.1/Mongrel/Apache setup and I’m attempting to  
configure Rails/Apache to force ssl. I’ve added the following line in  
my httpd-ssl.conf file, under the VirtualHost:

RequestHeader set X\_FORWARDED\_PROTO ‘https’

The redirect does not take place and instead we are seeing the entire  
contents of the public directory in the web browser. When going to  
https://, everything works great…just can’t get the redirect to work.  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![parki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@parki](https://www.ruby-forum.com/u/parki)\
**Post date:** [June 25, 2009, 5:09pm UTC](https://www.ruby-forum.com/t/redirect-http-to-https/171037/2 "2009-06-25T17:09:16Z")

</div>

Hi,

Have you tried this?

> **[GitHub - bcurren/ssl\_requirement: SSL Requirement plugin](https://github.com/bcurren/ssl_requirement/tree/master)**
>
> master

On 25 jun, 11:33, Brian P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
