Re: Redirecting and rewriting

From: Henrik Nordstrom <[email protected]>
Date: Sat, 23 Jan 1999 00:32:32 +0100

Sid Baldwin wrote:

> How do I make a redirection work for all of those relative links?

Change the redirector used to return a HTTP redirect instead of a
rewritten URL. This is done by prepending the new URL with the HTTP
status code that should be used. 302 is the appropriate HTTP redirect
code to use for this kind of redirects.

#!/usr/bin/perl
$|=1;
while(<>) {
  if ( m%^http://requested.www.server/path% ) {
     print "302:http://local.www.server/other/path$%b4\n";
  } else {
     print;
  }
}

---
Henrik Nordstrom
Received on Fri Jan 22 1999 - 18:26:36 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:44:07 MST