mod_rewrite : the weapon of mass-destruction.
I've been trying to learn mod_rewrite to do /anything/ and I'm failing. Please
take pity on me, oh mighty ones ! ;)
I wanted to use mod_rewrite as a technology test, and to learn something new,
but it has simply driven me to distraction... perhaps someone could help?
I have a woody box (installed yesterday) with vanilla Apache, and a customer
who has three domain names, and hundreds of files in /www/maindomain.ext.
They also own anotherdomain.ext and thirddomain.ext, and each domain has a
seperate defaultindex page - site1.html, site2.html, site3.html.
What I want to do is use mod_rewrite to check the entire URI they requested,
and "if http://www.anotherdomain.ext/ or http://anotherdomain.ext is
requested, then display site2.html" and so on for the third site.
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
I have this:
RewriteRule anotherdomain\.ext\/$ /site2.html
RewriteRule thirdomain\.ext\/$ /site3.html
This is just not doing it for me, and I see nothing in the log file (0 bytes,
same permissions/owner as the other access.log/error.log which work fine)
In fact, even doing something simple like
RewriteRule ^/gdh.* http://www.google.com/
doesn't have the desired effect :/
I'd be very grateful for any suggestions!