Hey
fleetfootmike!
Sep. 27th, 2004 10:31 pmGot a question for you related to the Rewrite engine in Apache. After the kind help you gave me before, I'm hoping you can clue me in on this. :)
Okay, here's what I've got in terms of rewrite rules in my httpd.conf right now:
RewriteEngine On
RewriteRule ^/mailman/ - [L]
RewriteRule ^/icons/ - [L]
RewriteRule ^(.*)$ http://www.murkworks.net$1 [R]
This is essentially redirecting all traffic that starts with murkworks.net (the newmoon server) over to www.murkworks.net (the lodestone server) UNLESS the URL contains /mailman/ or /icons/ right after the server name.
Now, however, I find myself needing to tweak this some. We host the domain upcc.org, and right now, we have it set up so that upcc.org points at newmoon (because we get mail at that domain) and www.upcc.org points at lodestone. I need to know the best way to make it so that my httpd.conf file redirects upcc.org traffic over to www.upcc.org. Can I also do this with a RewriteRule? And should it be above the last one so as to have higher precedence?
Or should I do this somehow via VirtualHosts? Right now, www.upcc.org properly goes to lodestone, but upcc.org is currently defaulting to the murkworks.net home page... because upcc.org maps to murkworks.net, and then the last rule there catches that and maps it over to www.murkworks.net.
Thanks in advance for any clues you can provide!
Okay, here's what I've got in terms of rewrite rules in my httpd.conf right now:
RewriteEngine On
RewriteRule ^/mailman/ - [L]
RewriteRule ^/icons/ - [L]
RewriteRule ^(.*)$ http://www.murkworks.net$1 [R]
This is essentially redirecting all traffic that starts with murkworks.net (the newmoon server) over to www.murkworks.net (the lodestone server) UNLESS the URL contains /mailman/ or /icons/ right after the server name.
Now, however, I find myself needing to tweak this some. We host the domain upcc.org, and right now, we have it set up so that upcc.org points at newmoon (because we get mail at that domain) and www.upcc.org points at lodestone. I need to know the best way to make it so that my httpd.conf file redirects upcc.org traffic over to www.upcc.org. Can I also do this with a RewriteRule? And should it be above the last one so as to have higher precedence?
Or should I do this somehow via VirtualHosts? Right now, www.upcc.org properly goes to lodestone, but upcc.org is currently defaulting to the murkworks.net home page... because upcc.org maps to murkworks.net, and then the last rule there catches that and maps it over to www.murkworks.net.
Thanks in advance for any clues you can provide!
no subject
Date: 2004-09-28 02:18 pm (UTC)NameVirtualHost 209.20.199.10
<VirtualHost 209.20.199.10:80>
ServerName murkworks.net
RewriteEngine On
RewriteRule ^/mailman/ - [L]
RewriteRule ^/icons/ - [L]
RewriteRule ^(.*)$ http://www.murkworks.net$1 [R]
</VirtualHost>
<VirtualHost 209.20.199.10:80>
ServerName upcc.org
RedirectMatch (.*) http://www.upcc.org$1
</VirtualHost>