Thanks, Sean...

I actually thought of that and then I thought,
"No, it couldn't be that simple."  So, instead of trying it,
I just typed that looooong explanation and question.

Now, I've just got to rewrite the paths for images and components.
Components paths are a pain that way, with their dot notation.

But, I just create two variables:

#application.activeWebroot#
#application.componentDirectory#

Satisfies image and component paths, at least.

Who know what else I'll run into...

Now, to rewrite all the paths in the entire site. Sigh...

Thanks!

Rick


-----Original Message-----
From: Sean Corfield [mailto:[email protected]] 
Sent: Wednesday, August 18, 2010 1:09 PM
To: cf-talk
Subject: Re: How to specify different webroots for development and
production in application.cfc


Why not activeWebroot = "/hillyPetersonHome" on dev and just "" on hph
/ production (and then use url =
"#application.activeWebroot#/images/image.jpg" (without the leading /)

On Wed, Aug 18, 2010 at 9:55 AM, Rick Faircloth
<[email protected]> wrote:
>
> Ok...I thought I had this worked out, but now I'm running into
> path issues on my server.
>
> What I'm trying to accomplish is this:
>
> - I'm using an SVN service to post changes to my web server
> - I commit a change to SVN, then SVN sends update to server
> - On the SVN server, I have two FTP sites set up to handle commits
> - One FTP site gets commits immediately...that's the development site,
>  or folder on my server
> - The second FTP site gets commits only manually...those go to the
>  production site (or folder) when testing and client approval is finished
>
> - To use this setup, I created three variables for
application.activeWebroot
> based
>  on the cgi.server_name in use and used this like this:
>
>        <cfif cgi.server_name contains 'localhost'>
>
>                <cfset application.activeWebroot = 'hillyPetersonHomes' >
>
>        <cfelseif cgi.server_name contains 'hph.whitestonemedia.com'>
>
>                <cfset application.activeWebroot =
'hillyPetersonHomes-dev'>
>
>        <cfelseif cgi.server_name contains 'hillyPetersonHomes.com'>
>
>                <cfset application.activeWebroot = 'hillyPetersonHomes'>
>
>        </cfif>
>
>
> This works fine for local development when using paths such as:
>
>        url = /#application.activeWebroot#/images/image.jpg
>
> That translates to http://localhost/hillyPetersonHomes/images/image.jpg.
>
> However, on the server, when domain names become involved, it doesn't
work.
> When, viewing a site in the development folder, using the domain
> "hph.whitestonemedia.com", this path:
>
>        url = /#application.activeWebroot#/images/image.jpg
>
> becomes:
>
>        url =
> http://hph.whitestonemedia.com/hillyPetersonHomes-dev/images/image.jpg
>
> which doesn't work.
>
> It needs to be http://hph.whitestonemedia.com/images/



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336359
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to