Our company has a website hosted and created by some company but we don't like the way things are handled so we decided to pull the plug and create & host our own website.Now the question is:Is rebuilding this website from scratch (so using nothing of the original code, but looking and functioning the same) considered plagiarism/illegal?Can the original designing/hosting company sue us or anything if they saw we took their website? Even if we can prove we have written it ourselves?
Is rebuilding a website considered plagiarism?
legal
This completely depends on your contract.  If you have a contract with them stating they will build a website and manage it for you, but they retain the rights, then no you can not rebuild it.  There are two separate issues.  One is the code to build the website, and one is the design.  It is the Design related contract that determines if you can rebuild with your own code but make the design the same.  If they own the rights to the design, for example, a well known design firm that lets you 'license' their design while under contract, you will not be allowed to use that same design.  If however, they have sold you the design during the purchase, you are free to do with it as you like.