Mailing List Archive

.htforward anyone???
[.lots of untested pipe-dreamery follows. I haven't got this
working yet, so you could just ignore what follows until I have]

Hulloo,

Non-admin information providors should be able to determine the redirection
capabilities of the server. [.Er, because I said so. No, well, actually
because it's not the server-admin's job to munge .conf files to redirect
access to my home-page subject to my whim.]

Would it be considered cool to have some kind of

.htforward

capability under Apache? sendmail has a .forward which contains various
scripty bits and pieces to allow incoming mail to be forwarded on to another
destination. The people who decide what-gets-.forwarded-where are the 'owners'
of the e-mail (the recipients) rather then the root user or some other admin.

An .htforward (or .htredirect) could sit in a public_html directory and
would be read by the server whenever a file was accessed in the same directory.
If a single file were used to redirect accesses to my index.html file onto
my COMMA home-page then it could look like this:

--- cut here ---
# .htredirect
# 1) I'm keeping my home-page on another site at the moment
index.html http://www.cm.cf.ac.uk/User/Andrew.Wilson/
# 2) All my apache documentation is held on hyperreal for the next few weeks
ApacheDocs/ http://www.hyperreal.com/apache/docs/andrew/
--- cut here ---

Ok, well that file establishes a mapping between:

http://you.are.here.com/index.html

and

http://www.cm.cf.ac.uk/User/Andrew.Wilson/

but it could be a bit cumbersome to have to read and parse the .htredirect
each time the directory was accessed. So how about another idea:

Let's say that the server sees all <filename>.redirect files as containing the
redirect-to URL for <filename>. So:

~andrew/public_html/index.redirect

would be :

--- cut here ---
http://www.cm.cf.ac.uk/User/Andrew.Wilson/
--- cut here ---

And

~andrew/public_html/ApacheDocs.redirect

would be:

--- cut here ---
http://www.hyperreal.com/apache/docs/andrew/
--- cut here ---

All this is semantically the same as specifying a cgi-script file-type in the
.conf files, and making each 'redirecting' script fool the server into issuing
a redirect. I don't understand how the .map/.var thing works yet so I'll bluff.
Just assume that the server knows that when you 'ask' for index.html you really
mean 'index.redirect'. index.redirect could look like:

--- cut here ---
#!/usr/local/bin/perl
print "Location: http://www.cm.cf.ac.uk/User/Andrew.Wilson/\n\n";
--- cut here ---

Anyway. There's a need for this (cuz I've been asked for it already so...),
is defining yet another custom file-type the best solution, bearing in mind that
I want the info-providors to have control over this functionality?

Cheers,
Ay.
Andrew Wilson URL: http://www.cm.cf.ac.uk/User/Andrew.Wilson/
Elsevier Science, Oxford Office: +44 0865 843155 Mobile: +44 0589 616144
Re: .htforward anyone??? [ In reply to ]
Date: Mon, 3 Apr 95 14:45:23 BST
From: Andrew Wilson <andrew@www.elsevier.co.uk>
Would it be considered cool to have some kind of

.htforward

capability under Apache? sendmail has a .forward which contains
various scripty bits and pieces to allow incoming mail to be
forwarded on to another destination. The people who decide
what-gets-.forwarded-where are the 'owners' of the e-mail (the
recipients) rather then the root user or some other admin.

These are good ideas, but I'd prefer to see them implemented by adding
Alias and Redirect directives to .htaccess files, rather than by
adding a second per-directory config file. (In my server profiles,
searching for .htaccess files, which are generally not present,
consumes nearly 30% of the server's CPU time --- searching for a
second set of per-directory config files would not come cheap).

I realize that this involves putting things in ".htaccess" files which
aren't concerned with access per se, but we already have them there
(AddType directives in particular), probably for exactly this reason.

rst
Re: .htforward anyone??? [ In reply to ]
On Mon, 3 Apr 1995, Andrew Wilson wrote:

...about the need to have redirecting a non-conf-file thang....

> All this is semantically the same as specifying a cgi-script file-type in the
> .conf files, and making each 'redirecting' script fool the server into issuing
> a redirect. I don't understand how the .map/.var thing works yet so I'll bluff.
> Just assume that the server knows that when you 'ask' for index.html you really
> mean 'index.redirect'. index.redirect could look like:
>
> --- cut here ---
> #!/usr/local/bin/perl
> print "Location: http://www.cm.cf.ac.uk/User/Andrew.Wilson/\n\n";
> --- cut here ---

Turn on MultiViews for that directory, and instead of "index.redirect",
rename it "index.html.cgi". This will (probably) even work where the
DirectoryIndex has been set to "index.html" and the request comes in for
just the directory, without the "index.html".

Don't forget to put in a "Status: 302" line too, that'll speed things up
(right guys?)

Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@hotwired.com brian@hyperreal.com http://www.hotwired.com/Staff/brian/
Re: .htforward anyone??? [ In reply to ]
Last time, Robert S. Thau uttered the following other thing:
>
> Date: Mon, 3 Apr 95 14:45:23 BST
> From: Andrew Wilson <andrew@www.elsevier.co.uk>
> Would it be considered cool to have some kind of
>
> .htforward
>
> capability under Apache? sendmail has a .forward which contains
> various scripty bits and pieces to allow incoming mail to be
> forwarded on to another destination. The people who decide
> what-gets-.forwarded-where are the 'owners' of the e-mail (the
> recipients) rather then the root user or some other admin.
>
> These are good ideas, but I'd prefer to see them implemented by adding
> Alias and Redirect directives to .htaccess files, rather than by
> adding a second per-directory config file. (In my server profiles,
> searching for .htaccess files, which are generally not present,
> consumes nearly 30% of the server's CPU time --- searching for a
> second set of per-directory config files would not come cheap).

It may be interesting to note that it was taken out of 1.3:

http_config.c

if(!file)
add_redirect(w,w2);
else
access_syntax_error(n,
"Redirect no longer supported from .htaccess files.",file,out);


> I realize that this involves putting things in ".htaccess" files which
> aren't concerned with access per se, but we already have them there
> (AddType directives in particular), probably for exactly this reason.

Also, httpd uses the same parser for both the access.conf and the .htaccess
files (just called in a different fashion)

Brandon

--
Brandon Long (N9WUC) "I think, therefore, I am confused." -- RAW
Computer Engineering Run Linux 1.1.xxx It's that Easy.
University of Illinois blong@uiuc.edu http://www.uiuc.edu/ph/www/blong
Don't worry, these aren't even my views.
Re: .htforward anyone??? [ In reply to ]
/*
* "Re: .htforward anyone???" by drtr@ast.cam.ac.uk (David Robinson)
* written Tue, 4 Apr 95 14:35 BST
*
* Brandon wrote:
** It may be interesting to note that it was taken out of 1.3:
** "Redirect no longer supported from .htaccess files.",file,out);
* Why?
*
*/

I don't remember the reasons offhand. God forbid I should have done
something sensible like put a comment around it explaining why I did
that.

As I recall, it had something to do with ordering... something about
name translation already being done by the time .htaccess files were
being parsed. I do remember trying it, realizing that the exact syntax
I wanted to use wouldn't work without some modifications to other
parts of the code, and decided that like everything else I just didn't
have the time to make it work. At the time there were some
particularly nasty crash bugs in the new parsed HTML code that needed
more attention.

--Rob
Re: .htforward anyone??? [ In reply to ]
[on non-admin people being able to issue redirects]

> Turn on MultiViews for that directory, and instead of "index.redirect",
> rename it "index.html.cgi". This will (probably) even work where the
> DirectoryIndex has been set to "index.html" and the request comes in for
> just the directory, without the "index.html".

Mmm, any advance on probably? I'll try to get my head into MultiViews this week,
but.

> Don't forget to put in a "Status: 302" line too, that'll speed things up
> (right guys?)

Why, because the server checks for Status: 302 before it looks for Location: in
script output?

> Brian

Ay.
Re: .htforward anyone??? [ In reply to ]
Brandon wrote:
>It may be interesting to note that it was taken out of 1.3:
>"Redirect no longer supported from .htaccess files.",file,out);

Why?

David.