Forum Moderators: phranque
What I want to do is setup my server so that all requests to the forum under the new domain will be rewritten to the old domain (that way the old links will continue to work and the new domain will work simultaneously).
For example: a request to [forum.newdomain.com...] will be rewritten to [forum.olddomain.com...]
I don't have access to httpd.conf but I do have .htaccess and I know that mod_rewrite works properly.
Anybody know how I can do this?
TIA!
However, if you simply wish the old domain links to continue to work, then a 301 Moved Permanently redirect from the old domain URLs to the new domain URLs is the recommended solution for best user experience and proper search engine indexing/ranking.
Redirecting the other way, from the new domain to the old domain, may seriously confuse the search engines and cause problems when the time comes that you want to take the new domain live. You will have been telling them for weeks or months that the new domain should be ignored and requests made instead to the old domain. Therefore, they may continue to ignore the new domain for quite some time, even after the redirect is removed.
The address bar should reflect the actual URL of a resource. It is often a very good sign that the wrong approach is being used when the phrase "force the address bar" appears in a post. Either that, or something untoward is being attempted. Apache is pretty good about not allowing the user to be confused about actual URLs. And note that URLs are not at all the same thing as 'files' -- Internal filepath rewrites are not usually problematic from a user-security standpoint, and so Apache does not constrain them. Although you're not really trying to fool anyone in this application, odds are that another approach will work better. The 'signalling' between clients and servers is well-defined in the HTTP protocol [w3.org], and strictly following that standard will lead to the correct solution (See request and response codes).
Jim