httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Turner <>
Subject Re: [users@httpd] mod_rewrite to shorten URLs (problem)
Date Mon, 23 Dec 2002 03:44:13 GMT
Adam Theo wrote:

>Gary Turner <> wrote:
>> I'm not sure I even qualify as a newbie, yet.  So, I will take this as
>> an opportunity for enlightenment.
>> Why don't you place WEB/TOPIC immediately under your doc root?  In
>> addition, remove the bin/ from the immediate dir tree for security
>> purposes.  Alias the CGI dir.
>> Is there a nontrivial (solving a vexing problem) reason for the rewrite?
>> You haven't made that clear to my novice eyes.  Whether serious or
>> simply an exercise for the class, I will follow along.  It looks
>> interesting.
>Hi. It's not a problem to explain  :)
>The reason why placing the WEB directories directly under the doc root 
>is because it is not actually the files in those WEB directories that I 
>want to access with the web browser, it is the parsed result of them.

So, these files are executables?  Called by a GET or POST method?  If
they are, isn't security weakened by having them under doc root at all?
Put the scripts under their own aliased root and the data files could be
accessed by a relative path
>This program is a Wiki, meaning it takes some simple markup like *text* 
>and turns it into HTML (<b>text</b>) on-the-fly, saving the authors the 
>trouble of having to know and type HTML. The Wiki scripts fetch the 
>files in the WEB directories, parse them, and present them to the browser.
>Next, I don't know exactly what you mean by aliasing the CGI dir. You 
>mean an apache Alias? As in I have everything as 
>*** be redirected to 
>***? Hmm... that might work as long 
>as I can make exceptions for the /pub directory and other CGI scripts in 

ScriptAlias /wiki/ /var/www/wiki-bin/	# I put scripts under
												 	# /usr/local/lib/cgi-bin/

ScriptAlias /cgi/ /var/www/cgi-bin/	 	# ditto

Alias /wiki-data/ /var/www/data/		 	# or whatever

As I RTFM, you can use any number of aliases.  *Gurus step in here*

Note that this puts everything in separate branches

>And I'm wanting to shorten the URL because I don't use anything under 
>the /bin/view part, so it seems pointless to clutter up the URL with 
>parts I don't use at all. It's a beautification matter.

I'll agree that paths that run into the next county are visual
pollution.  Aliases clean things up nicely.  Plus, as I understand it
they prevent stuff like (from) /bin/view/WEB/ GET ../../ which can print
your bin/ directory.  A less than noble individual might gain unwanted
advantage by reading your scripts, a Bad Thing.  Parallel branches off
the doc root should improve security.

That's the way I see it so far (without knowing jack about wikis).
Please keep us posted whichever way you get things working for you.
Please, everyone, correct my errors in grokking.
 If someone tells you---
 "I have a sense of humor, but that's not funny." 
                                  ---they don't.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message