sslonly and stg

Kevin Fenzi kevin at scrye.com
Wed May 1 16:50:07 UTC 2013


Greetings. 

There's been a long standing issue with sslonly sites and stg. 

When you go to 'http://site.stg.whatever" you are redirected to
'https://site.whatever' which is anoying. 

The current sslonly template has: 

<% if sslonly -%>
  Redirect 301 / https://<%= name %>/
<% else -%>

So it does a redirect to the site 'name' which is always the production
one. 

I'd like to fix this, and changing the above Redirect to: 

  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^(.+)$ [NC]
  RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

seems to work. I tested it on stg with the qa site. 

Can anyone see anything that would blow up if I made this change? 

kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20130501/d16da2fb/attachment.sig>


More information about the infrastructure mailing list