httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Israel Brewster <>
Subject [users@httpd] Basic mod_rewrite help
Date Fri, 28 Sep 2007 18:42:19 GMT
I am running a personal webserver with apache 1.3.33 on Mac OS X  
10.4. I have a main site set up at the root level of http://, and a second site set up at the subdirectory of / 
~mongoose. I recently added virtual hosts to my configuration, so now can be accessed directly at http:// This all works as expected. Now I would  
like to set things up such that if you typed 
~mongoose the address is re-written to http://, for which I believe the correct tool to be  

in my httpd.conf file there is the following sections at the root level:

LoadModule rewrite_module     libexec/httpd/
AddModule mod_rewrite.c

<IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteCond %{REQUEST_METHOD} ^TRACE
     RewriteRule .* - [F]

which came with the default install. In order to implement the  
desired changes, I added the following lines:

RewriteLog "/var/log/httpd/rewrite.log"
RewriteLogLevel 2

RewriteRule ^/~mongoose(.*)$1 [NC,L,R]

Yes, I know the R flag is redundant, however, all I am seeing in the  
rewrite log is entries like the following:

[28/Sep/2007:10:04:43 -0800] [] 
[rid#1822238/initial] (1) [per-dir /WebServer/Documents/] pass  
through /WebServer/Documents/favicon.ico

I have the root level of my webserver at /WebServer/Documents. Yes, I  
know it isn't standard, but I like it there :)

My first thought was that it wasn't matching the rule, maybe because  
of the ~ or something, so I tried several different variations on the  
match pattern, including the way to generic .*mongoose.* but nothing  
seems to have made a difference. At one point I was getting similar  
entries on the home directory for the /~mongoose page, but with  
subsiquent changes they stopped, and now I can't even get those back- 
I'm not sure what I changed to get them in the first place or make  
them stop. Can anyone tell me what I am missing here, and how I can  
make this work? Thanks.
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293

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