I have two different domains. Lets call them domain1 and domain2.
I need to mod rewrite:
www.domain1.com/some/stuff/after-domain
so that it becomes:
www.domain2.com/some/stuff/after-domain
Basically, everything after the domain should remain the same. The only difference should be changing the domain names. Can anyone help me with the rewrite rules for this. I've tried the following, but it's not working for me.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain2.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain2.com$
RewriteRule ^(.*)$ http://www.domain1.com/$1 [R=301,L]
</IfModule>
Also, please note, that {REQUEST_URI} and {REQUEST_FILENAME} will not work for this application.
Thank you in advance, as always.
EDIT: Per the request for more info, the result I get when using the rule above: http://www.domain1.comhttp//www.domain1.com/some/stuff/after-domain
Additionally, I forgot to specify that I'd like the domain1 to appear in the address bar URL, but pull content based on domain2 (is this even possible?)
AllowOverride
enabled in apache config? Need more info. – Panama Jack