Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a webapp under an alias on my server. I want this webapp to be redirected to HTTPS://. So here is my code:

alias.url += ( "/email" => "/srv/Applications/email/" )

$HTTP["url"] =~ "/email" {
 $SERVER["socket"] == ":80" {
  $HTTP["host"] =~ "(.*)" {
    url.redirect = ( "^/(.*)" => "https://%1/$1" )
  }
 }

 static-file.etags = "enable"
 etag.use-mtime = "enable"

 $HTTP["url"] =~ "/(plugins|skins|program)" {
  setenv.add-response-header  = ( "Cache-Control" => "public, max-age=2592000")
 }

}

Now the issues is if I access the email at http://site.com/email, it redirects to https://email for some reason, but if you access it at http://site.com/email/ it works fine. I was just wondering if the is a fix to this, or I will have that hanging /email issue stuck =/ Thanks for any help!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Try this:

$HTTP["url"] =~ "/email" {
 $SERVER["socket"] == ":80" {
  $HTTP["host"] =~ "(.*)" {
    url.redirect = ( "^/email(.*)" => "https://%1/email$1" )
  }
 }

Note: I didn't actually test this.

share|improve this answer
    
Works fine man, thanks! There is an issue with redirecting in chrome somewhere too, which is where I was stumbling. –  Kyle Dec 11 '09 at 11:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.