Merge two drupal website or change website address using htaccess file - 301 permanent move
I used to maintain two different website for different content, But I find out that I do not have much stamina for maintaining two separate website and thinking of merge my website into one.
Since both website have gain traffic and I do not want to lose any of their traffic , I set out to find ways of merging my websites without losing any traffic.
Fortunetly there 're ways of keeping the traffic loss minimum for merging two website. And It is the same step if you want to change your website 's address to another, and here 's how:
Steps for combining two website(Change website address)
- Move all of the content from the old website to the new address, you could do this manually or using other methods!
- Setting up redirect behaviour on your old website using the http 301 code,which stand for 'url address permanent move', we could redirect our old website 's traffic to our new website, the visitor might not even notice it.
The secret is at the .htaccess file, Although we could redirect all the traffic from our old website to the same one page on our new website , It is best that we could redirect each page on our old website to the appropriate page on our new website for best user experience.
To setup this url mapping, I have to setup a cross reference table, for each url of my old website, I add the corresponding url on my new website. and here 's the example:
open the .htaccess file under the main directory of my old website, I add the following cross reference content just below the line:
RewriteBase /
and here is the content I add:
RewriteRule ^url1 http://iniu.net/url1 [R=301,L]
RewriteRule ^url2 http://iniu.net/url2 [R=301,L]
...At the end of each line is the '301 permanent move' instruction specific only for drupal CMS.
- Inform search engine (google) that our website has been moved: We will follow google webmaster 's instruction to inform google that our website has been moved: Google has provide tools for this purpose, just sign in into google webmaster tools, There 's one menu 'Change of Address'
By selecting this menu, we could point our old website address to the new website address:

Now we 're done for merging our two website!
