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!

link|improve this question

24% accept rate
feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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