All,
tldr: domain1.com/keyword does not go to domain2.com/keyword using 301. It goes to the root (domain2.com) without the keyword folder / directory.
Let me break it down:
I had drupal installed on www.domain1.com
i then need to change the domain name. I simply used Cpanel for an add-on domain.
Now I have www.domain2.com pointing to the same files as www.domain1.com. All is working well.
i also have domain2.domain1.com pointing to the same place.
I have added the following to the bottom of my .htaccess
RewriteCond %{HTTP_HOST} ^domain1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.com$
RewriteRule ^(.*)$ "http\:\/\/www\.domain1\.com\/$1" [R=301,L]
RewriteCond %{HTTP_HOST} ^domain1\.domain2\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain1\.domain2\.com$
RewriteRule ^(.*)$ "http\:\/\/www\.domain2\.com\/$1" [R=301,L]Please assist me in making this happen:
1. www.domain1.com/anykeyword to successfully 301 redirect to www.domain2.com/anykeyword instead of www.domain1.com/anykeyword pointing to www.domain2.com
Thanks.
Using redirect module does not help me because i need it to be for *any* keyword, aka wildcard.
PS I already am pretty much combining many sites into one. I also have redirect and global redirect module installed and am using them for other 301's per single page. Mainly used from sites that were not part of this drupal install.
Comments
=-=
=-=
anyone?
bump, sorry I hate bumping,
bump, sorry I hate bumping, but I am really needing some input on this.
I have the same problem
I posted here a few weeks back http://drupal.org/node/1868098 with the same problem
After much more research and experimentation I found out that the rewrite rule is ok, it just needs to go above other rewrite codes in the .htaccess file.
I moved the code above the
# Various rewrite rules.
line in the .htaccess file and BOOM it worked.
Hope this helps someone.