move a site from one domain to another

b22222c

Distinguished
Jan 3, 2014
424
1
18,795
Hi, i want to build a new site on a subdomain to be hide from users and when its finished i want to move it to the main domain. Besides move files is there something i should do to put the site working? Thanks
 
When building the site use site-root paths, not absolute paths. Say your index.html page for the site you are working on is at yourdomin.com/newdomain/index.html and a page you are working on is at yourdomin.com/newdomain/subfolder2/page3.html Absolute paths will be yourdomin.com/newdomain/subfolder2/page3.html, while site-root would just be /subfolder2/page3.html

If you used Absolute paths all of your links would be wrong when you moved the site.
 
Hi, thanks for your reply, my old site is at
www.example.com
and i want to build the new site on
test.example.com
and then move the files from the subdomain to the main domain

What paths i am using this way? Thanks
 
In your scenario, is example.com the same site?
Are you moving from www.example.com to test.example.com or are you actually doing something more like www.site1.com to test.site2.com?

Does the website have databases or accessing any content outside of the files in the test folder?
 
Hi, i have a site on example.com with prestashop, but since upgrade prestashop is quite complicated i want to start to build a new one on test.example,com and then move the new site to my actual domain example.com. The databases are different and i start a new one on test.example.com. Thanks
 
Ok then, was not sure if you were just building a new site or transfering hosting providers/domainsas well.

Just keep all web pages on site-root paths as I said.
When you configure your site you will configure it so that www.example/test/ is your site root. When you wish to move it you change it to www.example.com to be your site root. Thus either way "../index.html" will be correct.

Now many Hosting companies require you to do special things with databases to setup the connection. I would put the database in its proper final folder to begin with and use an absolute path (www.example.com/yourdbfolder/yourdb.sql). This way your database connection will continue working.