Question about redirection using PHP on IIS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fartsniff

    Question about redirection using PHP on IIS

    Hello all.
    Win2k server, PHP 4.2.3, PHPNuke 6.0, IIS.

    This code works great for redirecting the user:
    $redirect = getenv("HTTP_HO ST");

    if ($redirect=="so mething.mydomai n.com"){
    header("Locatio n:http://www.mydomain.co m/modules.php?nam e=something");
    }

    However, if I try this:
    if ($redirect==www .mydomain.com/something){
    header("Locatio n:http://www.mydomain.co m/modules.php?nam e=something");
    }

    it generates 1) a 404 error, and 2) something about a TRANSLATE verb in my
    URLScan log.
    Does anyone know which IIS "verb" handles this ? I cannot find anything on
    TRANSLATE,
    and PHP is configured in IIS to accept/handle ALL verbs.

    Many thanks.


  • Tom Thackrey

    #2
    Re: Question about redirection using PHP on IIS


    On 30-Jul-2003, "fartsniff" <fart@sniff.com > wrote:
    [color=blue]
    > Win2k server, PHP 4.2.3, PHPNuke 6.0, IIS.
    >
    > This code works great for redirecting the user:
    > $redirect = getenv("HTTP_HO ST");
    >
    > if ($redirect=="so mething.mydomai n.com"){
    > header("Locatio n:http://www.mydomain.co m/modules.php?nam e=something");
    > }
    >
    > However, if I try this:
    > if ($redirect==www .mydomain.com/something){
    > header("Locatio n:http://www.mydomain.co m/modules.php?nam e=something");
    > }
    >
    > it generates 1) a 404 error, and 2) something about a TRANSLATE verb in my
    > URLScan log.
    > Does anyone know which IIS "verb" handles this ? I cannot find anything on
    > TRANSLATE,
    > and PHP is configured in IIS to accept/handle ALL verbs.[/color]

    In the second example you forgot the quotes around
    www.mydomain.com/something, so you got a php syntax error which probably
    resulted in no output hence the 404 error.

    --
    Tom Thackrey

    Comment

    • fartsniff

      #3
      Re: Question about redirection using PHP on IIS

      thanks - that was my fault in a hasty copy/paste.
      in there "real" code they quotes are there, and i still
      get the error.

      i am still looking thru my logs for the exact error.

      "Tom Thackrey" <tomnr@creati ve-light.com> wrote in message
      news:s02Wa.128$ wV.15705337@new ssvr21.news.pro digy.com...[color=blue]
      >
      > On 30-Jul-2003, "fartsniff" <fart@sniff.com > wrote:
      >[color=green]
      > > Win2k server, PHP 4.2.3, PHPNuke 6.0, IIS.
      > >
      > > This code works great for redirecting the user:
      > > $redirect = getenv("HTTP_HO ST");
      > >
      > > if ($redirect=="so mething.mydomai n.com"){
      > > header("Locatio n:http://www.mydomain.co m/modules.php?nam e=something");
      > > }
      > >
      > > However, if I try this:
      > > if ($redirect==www .mydomain.com/something){
      > > header("Locatio n:http://www.mydomain.co m/modules.php?nam e=something");
      > > }
      > >
      > > it generates 1) a 404 error, and 2) something about a TRANSLATE verb in[/color][/color]
      my[color=blue][color=green]
      > > URLScan log.
      > > Does anyone know which IIS "verb" handles this ? I cannot find anything[/color][/color]
      on[color=blue][color=green]
      > > TRANSLATE,
      > > and PHP is configured in IIS to accept/handle ALL verbs.[/color]
      >
      > In the second example you forgot the quotes around
      > www.mydomain.com/something, so you got a php syntax error which probably
      > resulted in no output hence the 404 error.
      >
      > --
      > Tom Thackrey
      > www.creative-light.com[/color]


      Comment

      Working...