I'm a little bit stuck on this. We have a meduim sized drupal 5 site that is currently hosting around 2,000 user created nodes (2,500 registered users). This site is hosted at a domain, lets call it oldproject.com and has been for around 12 months. Due to rebranding and other things, we want to change the domain name to newproject.com, while at the same time forwarding anything at the oldproject.com still going to the relevant page but at newproject.com so that subscriptions people have previously, or bookmarks etc. will still get to the right page. We have managed this the other way round - so at present:

newdomain.com/home - forwards to -> olddomain.com/home

However when we try it the other way

olddomain.com/home - forwards to -> newdomain.com/home

The server gets stuck in a loop. And indeed for example on the Site Configuration admin page, the home page still shows as olddomain.com/home.

Has anyone every attempted this, and if so, which settings or database contents do I need to change in order to make a new primary domain without drupal getting stuck in a loop.

Any help would be greatly appreciated! Thanks,

Adam

Comments

chrishaslam’s picture

Hi there

The domain name shouldn't really be hardcoded anywhere if you can help it, have you manually set $base_url in sites/all/settings.php ?

Also how are you trying to do the forward? You also need to consider the search engines need to be need notified properly via a 301 redirect which means moved permanently.

I usually prefer to do this outside of drupal at the apache vhost level with something like

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.newproject\.com
RewriteRule (.*) http://www.newproject.com/$1 [R=301,L] 

If they both point to the same webroot via serveralias then you will need to tell this rewrite rule not to redirect newproject to itself, which it will do unless told otherwise.

The rewriterule also passes on previous URLs so old.com/url will also 301 to new.com/url

The second line

---------------------------
http://www.Footy247.co.uk

---------------------------
Managed Drupal hosting from Ixis IT