Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

references on live server vs localhost

Status
Not open for further replies.

gtbikerider

Technical User
May 22, 2001
81
GB
I'm referencing a file - e.g. a style like...
@import url("/myfolder/myfile.css");

This works fine when on the live server - it finds the file at
However when I work locally I user
etc

So the above reference won't work - I'd have to use...
@import url("/client1/myfolder/myfile.css");

How do you set up the local server so I can use the same code locally and live?





--
John
 
Yep i agree with Falconseye,

I tend to set all my site roots and cfc roots etc in the application.cfm file, then just referance them as a variable.

That way i can run the site on any test server i like in any folder, then when i shift the site over its a simple case of modifying the application file.

Rob
 
me three. I generally have an application.settings structure that has things like dsn, domain name, root path, physical path, etc in it.

I also build in debugging so that url,form,session,etc.. is displayed at the end of each pach automaticaly when in dev, but not on production. kinda handy to be able to move an entire site to production, and not have to fiddle with much stuff.

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Yep, another little item i like to use which makes life easy when shifting stuff around.

Code:
#expandPath(".")#

Any time you find yourself hard coding the same address or path more than a couple of time you're better off setting it as a variable.

Like kevin suggests, iether place them all in the applications file, or even create a set of sub-documents that contain different settings variables for your application.

Makes site maintanance and management so much easier.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top