Basic mod_rewrite help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:// izzy.homeip.net, and a second site set up at the subdirectory of / ~mongoose. I recently added virtual hosts to my configuration, so now http://izzy.homeip.net/~mongoose can be accessed directly at http:// mongoosedelta.homeip.net. This all works as expected. Now I would like to set things up such that if you typed http://izzy.homeip.net/ ~mongoose the address is re-written to http:// mongoosedelta.homeip.net, for which I believe the correct tool to be mod_rewrite.

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

LoadModule rewrite_module     libexec/httpd/mod_rewrite.so
AddModule mod_rewrite.c

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

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(.*) http://mongoosedelta.homeip.net/$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] [izzy.homeip.net/sid#1840290] [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:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux