Son of Not So Simple Redirect
Some good email going back-n-forth on this redirect issue. The funniest being NZ’s reply to one of us who said “work through your service provider” to which he responded with a very politely worded version of “duh!” Sometimes we geeks tend to throw stuff out there like spagetti - these last few pieces sliding down the wall under the category of “stating the obvious.”
Grins’n'giggles aside, I wanted to cover some of the information that has been exchanged. Keith Devens writes: “Just for reference, here’s the mod_write redirect, but it’s expensive because
Apache has to do a sub-request on every request. It’s basically something like
(this assumes they’re on different servers):“
RewriteCond %{HTTP_HOST} wmdi.com
RewriteRule . http://www.truthlaidbear.com/blogmd/%{REQUEST_URI}
Anders Jacobsen adds I’ve used Apache redirect a lot myself, and it works like a charm.
Keith; the solution you are proposing is very ISP specific, and if they make it that easy for you to set up virtual hosts (at no extra charge) something makes me think that they aren’t using “Real” virtual hosting (i.e. separate IPs for all virtual hosts). I use pair.com, and an explanation of their policy can be found here…
I personally have been so busy with my ‘real job’ that I haven’t had a chance to test out these various approaches - or some variation on a theme. Though I did have some redirect fun at the expense of an individual who has been harassing a member of Redland Baptist Church. This individual, frustrated by the court system, has linked some pages of Redland’s website - why? I don’t know. Though we were recently spammed. Perhaps that same someone wants others to do the same? Regardless, because the RBC site implements Server Side Includes, I have been able to take any traffic from identifiable ‘hate pages’ and give them an entirely different message. Here’s an example from the staff/contacts page at RBC
<h4>All inquiries via the Big Jerk should be referred to our attorney at …
</h4>
<!–#else –>
<!–#include virtual=”/includes/contactinfo.shtml” –>
<!–#endif –>
I’m going to return to this issue later this week when I figure out a solution, but until then, here are some resources you may find useful in your quest to redirect:
- A List Apart: Slash Forward
- A List Apart: How to Succeed With URLs, Part One
- A List Apart: URLS! URLS! URLS!
- Keith Devens .com - Fun with mod_rewrite
- Keith Devens .com - Look Ma! No extensions!
- A Users Guide to URL Rewriting with the Apache Webserver
- Apache module mod_rewrite
- CrazyGrrl.com - .htaccess Files
In the meantime, try tinkering with the following that I found via the support page at Prestwood.com - as this is where I’m going to start once I get some free time:
Options +FollowSymlinks
RewriteBase /
# Rewrite Rule for machine.domain-name.net
RewriteCond %{HTTP_HOST} machine.domain-name.net$
RewriteCond %{REQUEST_URI} !machine/
RewriteRule ^(.*)$ machine/$1










