beginner's request - domain redirect

Topics: Developer Forum, User Forum
Feb 9, 2007 at 6:39 PM
We're in a bit of emergency mode here. We have two domain names pointing to the same physical server, but one domain name is being phased out. Until we get an ISAPI filter working, the whole site is down (managment's decision) and both resolve to the same server, and the same site.

So this is the behavior I want to happen for every single page and file on the site:

1) User types in

2) Browser is immediately redirected to

3) If the user types in the favored new domain, it works as normal.

And that's it. No complex mapping, URL re-writing or anything.

I have attempted to write the code to implement what I believe should be a simple redirect, but it just doesn't work. I'm sure it's my total lack of knowledge of the Apache-like syntax, and inexperience with regular expressions. I hate to ask others to do my work for me, but I'm not even sure where to start.
Feb 9, 2007 at 8:22 PM
Alright, don't waste your time responding to my silly question. I eventually figured it out and it works great. Awesome tool, Cheeso. Thanks!

RewriteCond %{HTTP_HOST} ^www\.oldname\.org
RewriteRule ^(.*)$$1 R=301,L
Feb 24, 2007 at 1:22 AM
RTFM is not dead!