Header Redirect Bug

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

    #16
    Re: Header Redirect Bug

    Chung Leong wrote:
    [color=blue]
    > Is the script dying after the first call to header()? Run this and
    > see which files get created:
    >
    > header("HTTP/1.1 301 Moved permanently");
    > touch("after_fi rst_header");
    > header("Locatio n: http://www.example.com ");
    > touch("after_se cond_header");
    >
    > // perhaps track_errors is on?
    > fwrite(fopen("p hp_errormsg", "w"), $php_errormsg);
    >
    > Also try changing the header to "HTTP/1.0".
    >[/color]

    Thanks for trying to help. The script idea doesn't work on my
    misconfigured served which I don't have complete control over. The
    "php_errorm sg" was created, but empty. I'm now trying to figure out how
    to solve this problem right within the htaccess file, and this is my
    current try:

    RewriteEngine on
    Options +FollowSymlinks
    RewriteBase /
    RewriteRule ^(.*)-([0-9]*).html show.php?title= $1&part=$2

    And then someone suggested this but it doesn't quite work for me...

    RewriteCond %{QUERY_STRING} ^title=([a-z]+)&part=([0-9]+)
    RewriteRule ^book.php$ %1-%2? [redirect=perman ent]

    Comment

    • FLEB

      #17
      Re: Header Redirect Bug

      Regarding this well-known quote, often attributed to Philipp Lenssen's
      famous "21 Jan 2004 09:04:55 GMT" speech:
      [color=blue]
      > Pedro Graca wrote:
      >[color=green]
      >> Philipp Lenssen wrote:[color=darkred]
      >>> ------- Sample -------
      >>> <?
      >>> header("HTTP/1.1 301 Moved permanently");
      >>> header("Locatio n: http://www.example.com ");
      >>> ?>
      >>> ----------------------[/color]
      >>
      >> Does the redirection work with your sample script being the whole
      >> script?[/color]
      >
      > Yes. No spaces before or after. Complete sample above pasted into
      > text-editor, uploaded via FTP, and run via HTTP -- Error 500 (exact
      > error shielded by server).[/color]

      Any chance you can get to your error log files? Also, have you tried
      threatening bodily harm to your provider's employees unless they start
      showing you your rightly-deserved error messages...

      Who knows, it might work... might get you thrown in jail, tho'.

      --
      -- Rudy Fleminger
      -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
      (put "Hey!" in the Subject line for priority processing!)
      -- http://www.pixelsaredead.com

      Comment

      • R. Rajesh Jeba Anbiah

        #18
        Re: Header Redirect Bug

        "Philipp Lenssen" <info@outer-court.com> wrote in message news:<buli47$ig 1gn$3@ID-203055.news.uni-berlin.de>...[color=blue]
        > Pedro Graca wrote:
        >[color=green]
        > > Philipp Lenssen wrote:[color=darkred]
        > > > Pedro Graca wrote:
        > > >
        > > >> Philipp Lenssen wrote:
        > > >> > ------- Sample -------
        > > >> > <?
        > > >> > header("HTTP/1.1 301 Moved permanently");
        > > >> > header("Locatio n: http://www.example.com ");
        > > >> > ?>
        > > >> > ----------------------
        > > >>
        > > >> Does the redirection work with your sample script being the whole
        > > >> script?
        > > >
        > > > Yes. No spaces before or after. Complete sample above pasted into
        > > > text-editor, uploaded via FTP, and run via HTTP -- Error 500 (exact
        > > > error shielded by server).[/color]
        > >
        > > I guess you mean it does not work.
        > >[/color]
        >
        > Yes, sorry got it mixed up. It does _not_ work.
        >[color=green]
        > > ... have you tried switching the header()s order?[/color]
        >
        > Good idea. Will try.
        >
        > Nope. Same 500 error.[/color]

        Adjust your browser settings to see no-friendly HTTP message or
        just use some HTTP sniffers to see the all the responses. I guess, the
        script dies somewhere. May be you could post the URL of the page?

        --
        "We live to die; We die to live"
        Email: rrjanbiah-at-Y!com

        Comment

        • Philipp Lenssen

          #19
          Re: Header Redirect Bug

          R. Rajesh Jeba Anbiah wrote:
          [color=blue]
          > Adjust your browser settings to see no-friendly HTTP message or
          > just use some HTTP sniffers to see the all the responses. I guess, the
          > script dies somewhere. May be you could post the URL of the page?[/color]

          It's the error message HTML of my host... not the browser-one... but
          thanks to all I officially give up on solving this with PHP and instead
          try to solve it via htaccess. In fact I offer $20 at Google Answers for
          a solution:
          <http://answers.google. com/answers/threadview?id=2 99291>

          Comment

          Working...