1

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!

1

Try this:

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

Note: I didn't actually test this.

|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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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