Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

Moving sites from development to online

5:57 pm on Mar 8, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 30, 2008
votes: 0

When I take sites from development on my MacBook to the real online server, there is usually a lot to change. How you guys do it?

What I mean is that I build a site using folders in the APache document root. This means that the base URL for the new site is /folder/ instead of directly root. SO when I have to bring the site online, I need to change all those references. How do the veterans on here develop so that as little code needs to be changed when going online? Any success with virtual hosts?

3:39 am on Mar 9, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Mar 30, 2006
votes: 88

I work with relative paths:

I got used to working with templates having strict code, so then if I need to change something, its two files (or a bunch) and a text replace does the work with an text editor.

I'm managing only two pages now (template) and use my own CMS to work the rest out, so no changed needed. If so, I do it via preferences (CMS).

11:26 am on Mar 16, 2009 (gmt 0)

Senior Member

joined:July 29, 2007
votes: 100

Relative paths are extremely useful as explorador says.

I'd also recommend taking your workspace online but keep it in sandbox state where nobody but you can find/access it.

1:52 am on Mar 17, 2009 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:June 4, 2002
votes: 3

I develop a site on my own domain (no followed) using relative URLs so the owner can view and approve the pages. Once it's ready to go online I change all urls to full and remove no follow, add base hrefs, fix htacess, etc and load it. It usually takes 3 hours to get a small site ready for going online till it's finished (not including a shopping cart).
2:54 pm on Mar 17, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 19, 2004
votes: 0

I used to use relative paths, but switched to absolute complete URLs for a few reasons.

I include a $domain global variable in the configuration file for each site.

Whenever a site is moved, all that has to be changed is the value for $domain and I'm good to go.

3:06 pm on Mar 17, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:May 4, 2004
votes: 0

you could also include some if-else statements. like if the server path is x, then some parameter is a. if server path is y than that same parameter is b. this works for image upload locations, database connection details and lots of over things