Forum Moderators: phranque
I was fiddling around with my .htaccess file, because I want quux-foo.com to go to http://www.example.com/quux-foo/19/rise-up/
Here is what I have, after RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www\.quux-foo\.com [NC]
RewriteRule \.quux-foo\.com\ http://www.example.com/quux-foo/19/rise-up/ [R] It's not working, which in naturally why I'm here now. Got any advice?
[edited by: jdMorgan at 2:53 am (utc) on Oct. 5, 2006]
[edit reason] Obscured domains. Please see TOS. [/edit]
you say you redirected B to A so by the time the browser gets to your server, Domain B is not being requested anymore (A is you told it to request A).
you may be able to set the parked domain to forward to: http://www.example.com/quux-foo/19/rise-up/
directly. If the domains are both pointed to your server you could just make the root of domain B the subdir of A.
In addition, unless you have only one page (with no images or anything else) on the entire quux-foo domain, you will likely want to 'copy' the URL-path (e.g. page name) requested from quux-foo into the new url on example.com, so that quux-foo.com/abc redirects to example.com/abc, and quux-foo.com/xyz redirects to example.com/xyz. That is accomplished by using 'back-references' in mod_rewrite.
RewriteCond %{HTTP_REFERER} ^http://(www\.)?quux-foo\.com [NC]
RewriteRule (.*) http://www.example.com/quux-foo/19/rise-up/$1 [R=301,L]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim