Re-routing URL requests

Re-routing URL requests

Post by Greg Kee » Thu, 01 Jun 1995 04:00:00



Is there a way (either with a perl CGI program some other method) to send
any hit on a specific URL on one server to a URL on another server.

I tried the Alias command in srm.conf (NCSA httpd 1.3) and it wouldn't
work, it only works on the same server, but the concept is the same.

To be sure that I'm clear...  In other words, if you requested
http://server1.com/request.html you would actually go to
http://server2.com/actual.html.

If request.html needs to be a CGI script, I can handle that, just need to
know the re-direct code.

Thanks!

Greg Keene

***************************************************************
Greg Keene                            The Watertown Group, Inc.

phone - 503/753-7551                         fax - 503/753-5548

***************************************************************

 
 
 

Re-routing URL requests

Post by Joachim Mart » Fri, 02 Jun 1995 04:00:00


: Is there a way (either with a perl CGI program some other method) to send
: any hit on a specific URL on one server to a URL on another server.

: If request.html needs to be a CGI script, I can handle that, just need to
: know the re-direct code.

Try (in Tcl):

---
#!/usr/local/bin/tcl -f
puts "Location: http://www.harvard.edu/\n\n" ;# 'print' for perl?
---

Works for me! (NCSA + Netscape/Lynx) -Joachim
-------------------------

Systems Librarian               http://sirin.harvard.edu/~jmartin
Office for Information Systems  Harvard University Library

 
 
 

Re-routing URL requests

Post by andrew j muell » Fri, 02 Jun 1995 04:00:00


Quote:>(Greg Keene) writes:
>Is there a way (either with a perl CGI program some other method) to send
>any hit on a specific URL on one server to a URL on another server.

>I tried the Alias command in srm.conf (NCSA httpd 1.3) and it wouldn't
>work, it only works on the same server, but the concept is the same.

        You were very, very close! Use the "redirect" directive. It's
        very simple. ex:

        Redirect virtual URL
        virtual is the translated location which should trigger a redirect.
        URL is the URL of the new document

        Redirect /dir1 http://newserver.widget.com/dir1

        This would cause requests for /dir1 to be redirected to the new
        location, http://newserver.widget.com/dir1.

Quote:>To be sure that I'm clear...  In other words, if you requested
>http://server1.com/request.html you would actually go to
>http://server2.com/actual.html.

>If request.html needs to be a CGI script, I can handle that, just need to
>know the re-direct code.

        No need for anything that fancy. The server does it all for you.
        Double check the docs on the Server resource map.

        Andrew Mueller
        HyperMedia Programmer
        Nationwide Life Insurance Co.

 
 
 

Re-routing URL requests

Post by Steven Pritcha » Sat, 03 Jun 1995 04:00:00





>>Is there a way (either with a perl CGI program some other method) to send
>>any hit on a specific URL on one server to a URL on another server.
>You can do it with a "Redirect" line with the CERN server.
>You can do it with  "Location: URL" output from a CGI script in place
>   of a "Content-type" header.

You can also use <BASE HREF="http://some.other.host/document.html">.  It
will load the document from the original URL, but graphics and links will
be treated as if the URL were the one in the <BASE HREF> tag.

Steve
--
Steven Pritchard                | http://osiris.intrnet.net/

(618)687-INET                   | Allied Access Tech Support

 
 
 

Re-routing URL requests

Post by James J. Lippa » Sat, 03 Jun 1995 04:00:00




>Is there a way (either with a perl CGI program some other method) to send
>any hit on a specific URL on one server to a URL on another server.

>I tried the Alias command in srm.conf (NCSA httpd 1.3) and it wouldn't
>work, it only works on the same server, but the concept is the same.

>To be sure that I'm clear...  In other words, if you requested
>http://server1.com/request.html you would actually go to
>http://server2.com/actual.html.

>If request.html needs to be a CGI script, I can handle that, just need to
>know the re-direct code.

You can do it with a "Redirect" line with the CERN server.
You can do it with  "Location: URL" output from a CGI script in place
   of a "Content-type" header.
--

Phoenix, Arizona  http://www.primenet.com/~lippard/
PGP Fingerprint: 35 65 66 9F 71 FE 50 57  35 09 0F F6 14 D0 C6 04
 
 
 

Re-routing URL requests

Post by Rob Davi » Wed, 07 Jun 1995 04:00:00




> : Is there a way (either with a perl CGI program some other method) to send
> : any hit on a specific URL on one server to a URL on another server.

You can also, with Netscape 1.1, use client pull.  Include inside the head tag, before any body
text the following tag:
<meta http-equiv="Refresh" content="10; url=http://other.machine/other_directory/file.html">

This would wait 10 seconds (content="10;) and then access the url specified.

Rob
--


http://www.unn.ac.uk/~isu8/

 
 
 

Re-routing URL requests

Post by Victor Parada » Wed, 14 Jun 1995 04:00:00


Hola mundo.


>Is there a way (either with a perl CGI program some other method) to send
>any hit on a specific URL on one server to a URL on another server.
>I tried the Alias command in srm.conf (NCSA httpd 1.3) and it wouldn't
>work, it only works on the same server, but the concept is the same.

Just before the Alias command, there is a Redirect command in srm.conf:

Redirect /request.html http://server2.com/actual.html

...or use the new ErrorDocument command available in httpd 1.4 and a
script.

Hope this helps!

Bye...   ++Vitoco
--
Lic. Victor A. Parada                  __     __     Universidad Tecnica
Ingenieria Civil en Informatica     o-''))_____\\    Federico Santa Maria,

http://www.inf.utfsm.cl/~vparada/   c_c__/-c____/    +56 32 626364 x431 :-)

 
 
 

Re-routing URL requests

Post by Berend_W_van_Bemm » Fri, 23 Jun 1995 04:00:00



>Is there a way (either with a perl CGI program some other method) to send
>any hit on a specific URL on one server to a URL on another server.
>I tried the Alias command in srm.conf (NCSA httpd 1.3) and it wouldn't
>work, it only works on the same server, but the concept is the same.
>To be sure that I'm clear...  In other words, if you requested
>http://server1.com/request.html you would actually go to
>http://server2.com/actual.html.
>If request.html needs to be a CGI script, I can handle that, just need to
>know the re-direct code.
>Thanks!
>Greg Keene
>***************************************************************
>Greg Keene                            The Watertown Group, Inc.
>phone - 503/753-7551                         fax - 503/753-5548

>***************************************************************

For the CERN serverver you can return a new location by
echoing:

"Location: [YOUR URL] \n\n"

to the server. (All this from a cgi script). You don't need
to include a MIME type, if I'm right this is already a MIME
type.

Good Luck,

Berend W. van Bemmel

 
 
 

Re-routing URL requests

Post by Randal L. Schwar » Fri, 23 Jun 1995 04:00:00


Berend> For the CERN serverver you can return a new location by
Berend> echoing:

Berend> "Location: [YOUR URL] \n\n"

Berend> to the server. (All this from a cgi script). You don't need
Berend> to include a MIME type, if I'm right this is already a MIME
Berend> type.

However, you *do* need to return "Method: GET" if your CGI was invoked
by a PUT (like a form).  I got bit by that recently, so the pain is
still there. :-)

Just another perl-hacking web-head,

--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying

Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>

 
 
 

Re-routing URL requests

Post by Rory Murta » Sun, 25 Jun 1995 04:00:00



   Date: 22 Jun 1995 10:18:40 GMT
   Organization: XS4ALL, networking for the masses

   >Is there a way (either with a perl CGI program some other method) to send
   >any hit on a specific URL on one server to a URL on another server.
...
   >To be sure that I'm clear...  In other words, if you requested
   >http://server1.com/request.html you would actually go to
   >http://server2.com/actual.html.

   >If request.html needs to be a CGI script, I can handle that, just need to
   >know the re-direct code.

I use the following script from inetd with rcp_wrapper to redirect all
requests from one server to another:

#!/usr/local/bin/perl

( $page ) = ( <STDIN> =~ /GET\s+\/(.*)\s+HTTP\/1\.0/i );

$page = "actual.html" if ( $page =~ /request\.html/ );

print <<EOF
HTTP/1.0 302 Found
Date: Monday, 13-Feb-95 18:39:11 GMT
Server: NCSA/1.3
MIME-version: 1.0
Location: http://www.wri.com/$page
Content-type: text/html

<HEAD><TITLE>Document moved</TITLE></HEAD>
<BODY><H1>Document moved</H1>
This document has moved <A HREF="http://www.server2/$page">here</A>.<P>
</BODY>

EOF

- hope this might help,

 
 
 

1. Routing URL Requests of User Home Page Questions?

Hello,

    I am new to AIX and UNIX Sys Admin in general, so forgive me if this
is a basic question.  I am trying to set up a web page server using the
built in httpd.  I have successfully routed the homepage URL to the
appropriate server root directory.  And I have successfully routed
requests to user home pages to the appropriate root directory.  As an
example, www.mypage.com/~jones correctly routes to jones' WWW directory
in the home directory.  However, I am running into problems trying to
correctly enable links off of the user site.  So if a link on jones'
home page is something like www.mypage.com/~jones/teaching/class.html or
even www.mypage.com/~jones/class2.html returns a 404 file not found
error.  I have checked all of the permissions and they are okay.  In the
Configuration and Forms, under Request Routing, I have set a Pass: /~*
to /home/*/WWW/* (since all user directories will have a WWW for web
files).  I have also entered the WWW directory under User directory
Forms, but to no avail.  What am I doing wrong?

Thanks,

Albert Ihochi

--
----------------------------------------------------------------
Albert Ihochi
Ph.D. Student
Department of Materials Science and Engineering

Stanford University
416 Escondido Mall
Peterson Building 550, Room 554D
Stanford, CA 94305-2205

Tel: (650) 723-2939
Fax: (650) 725-4034

----------------------------------------------------------------
--

2. xv 3.10a with x86

3. Re-routing Printer Output

4. Floppy does not work under AIX 4.1.2

5. Re-routing DocumentRoot based on hostname

6. NIS+ won't create encrypted column

7. Re-routing via third party for certain IPs

8. S3 ViRGE/MX lock up SVGA server on laptop

9. Re-routing email from a particular sender

10. re-routing parallel port to a file

11. Re-routing a process's 'tty' output

12. ADSL Hostname & re-routing root mail

13. data pipes and re-routing