Calling regex geeks!
Sep. 12th, 2004 11:02 amI need to tell Apache on newmoon to redirect all web hits over to lodestone--except that I want to allow any hits to newmoon that invoke the Mailman web UI to come on through.
I already have a RedirectMatch line that redirects anything of the form murkworks.net/~username. But I want to redirect anything in the Document Root, and NOT direct anything of the form murkworks.net/mailman/whatever.
Does anyone have any brilliant suggestions as to a regular expression I can feed the Apache config file to make it redirect anything that ISN'T murkworks.net/mailman/whatever? I tried a negative lookahead assertion, but when I try to restart apache, it bitches about not being able to compile the expression.
I already have a RedirectMatch line that redirects anything of the form murkworks.net/~username. But I want to redirect anything in the Document Root, and NOT direct anything of the form murkworks.net/mailman/whatever.
Does anyone have any brilliant suggestions as to a regular expression I can feed the Apache config file to make it redirect anything that ISN'T murkworks.net/mailman/whatever? I tried a negative lookahead assertion, but when I try to restart apache, it bitches about not being able to compile the expression.
no subject
Date: 2004-09-12 12:46 pm (UTC)Wokay.
Try:
RewriteRule ^/mailman/ - [L]
RewriteRule ^(.*)$ http://lodestone.murkworks.net/$1 [R]
no subject
Date: 2004-09-12 12:52 pm (UTC)RewriteEngine On
too)
no subject
Date: 2004-09-12 01:06 pm (UTC)Okay, this seems on initial testing to be working correctly, except that I notice that it's adding an extra slash to the URLs it's rewriting to be lodestone ones. So I took the / out of the second rule you listed above, and that seemed to fix that problem *AND* let URLs of the form murkworks.net/~username punt over to lodestone as well.
So this seems to work like a charm. Thanks Mike! :)
no subject
Date: 2004-09-12 01:11 pm (UTC)There is *so* much you can do with it, it's untrue. http://httpd.apache.org/docs/misc/rewriteguide.html for a few more scary examples.
no subject
Date: 2004-09-12 01:56 pm (UTC)