Project

General

Profile

Actions

Bug #495

closed

can't use $HTTP["remoteip"] inside $HTTP["url"]

Added by Anonymous almost 19 years ago. Updated over 16 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

The following works :


  $HTTP["url"] =~ "^/some_path($|/)" {
    ....
  }

while the following does not:


$HTTP["url"] =~ "^/some_path($|/)" {
  $HTTP["remoteip"] != "10.10.0.0/24" {
    ....
  }
}

in fact, having the remoteip part inside the url part prevents anything else in the url part from working... ex


$HTTP["url"] =~ "^/some_path($|/)" {
  dir-listing.activate = "disable" 
  $HTTP["remoteip"] != "10.10.0.0/24" {
    ...
  }
}

the dir-listing.activate will not be used at all. If you remove the remote ip part:


$HTTP["url"] =~ "^/some_path($|/)" {
  dir-listing.activate = "disable" 
}

it works as expected.

-- lorinel

Actions #1

Updated by jan almost 19 years ago

cosmetic cleanups

Actions #2

Updated by darix almost 19 years ago

this is a general problem. stacked conditionals are not work at all atm.

Actions #3

Updated by moo over 18 years ago

it's a known problem that $HTTPurl cannot contains conditions other than another $HTTPurl. workarround:


$HTTP["remoteip"] != "10.10.0.0/24" {
  ...
  $HTTP["url"] =~ "^/some_path($|/)" {
    dir-listing.activate = "disable" 
  }
}
else $HTTP["remoteip"] == "10.10.0.0/24" {
  ...
  $HTTP["url"] =~ "^/some_path($|/)" {
  }
}

to avoid duplicating $HTTPurl =~ "^/some_path($|/)", u can put it into a file and include it.

Actions #4

Updated by jan over 17 years ago

  • Status changed from New to Assigned

can you try if this is fixed in 1.4.17 ?

Actions #5

Updated by Anonymous over 17 years ago

The same issue as in #1164 - works in 1.4.17 with patch.

Actions #6

Updated by stbuehler almost 17 years ago

  • Status changed from Assigned to Fixed
  • Resolution set to fixed

Fixed in r2080, see #1164

Actions

Also available in: Atom