5 Replies Latest reply on Dec 6, 2010 6:01 AM by PFB_PFB

    Solution to using Site Root with Sub-folders on Testing Server & Browser Previews

    PFB_PFB

      Hi Everyone

       

      Have found an elegant solution when using Site Root relative linking for a website, that allows browser previews, even when the testing server uses sub-folders and the live code references just the server site root " / " of the live server and not the sub-folder structure of the testing server.  This is really useful when you don't want to use document relative linking, which normally takes care of this problem in Dreamweaver.

       

      The solution is to use sub-domains referencing the sub-folders on the testing server, so the sub-folders appear as the root of each website and the html code pointing to the site root works correctly on both testing & live servers without alteration.

       

      Testing Server Setup

      One testing server domain is used for all client development work:

      For example:  www.testingserver.com

       

      On the testing server there are multiple sub-folder (one for each client website being developed):

      For example:  www.testingserver.com/clientA/www.testingserver.com/clientB/ , www.testingserver.com/clientC/

       

       

      Live Server Setup

      The site code needs to be developed with the final live server folder structure (url references) in mind:

       

      For example:  www.livesite.com (with all pages referencing the root of the live site server)

       

       

      Page URLs on Testing & Live Servers

      /page-name.html

      Testing server url:  www.testingserver.com/clientA/page-name.html

      Live server url:  www.livesite.com/page-name.html (without /clientA/ sub-folder)

       

       

      Browser Previews Don't Work

      You want to be able to run browser previews on the testing server while developing the website.  To do this you normally have to reference the sub-folder structure of the testing server in the url for things to work right:

       

      For example www.testingserver.com/clientA/page-name.html

       

      What do you do, when you can't keep switching all the urls in the code from pointing to the sub-folder to pointing to the site root, and you don't want to use document relative linking?

       

       

      One Solution - Sub-domains on Testing Server

      In your domain hosting (outside of Dreamweaver) setup a sub-domain to point to the testing server sub-folder.

       

      For example:  Sub-domain clientA.testingserver.com points to www.testingserver.com/clientA (sub-folder)

       

      So now when you reference the sub-domain it sees the sub-folder as the site root and all your problems are solved.

       

       

      Dreamweaver Site Definition Setup

      Site Definition under "Local Info"

      Links relative to: Site Root

       

      Site Definition under "Remote Info" (live server)

      Access: FTP

      FTP host:  ftp.livesite.com

      Host directory: /

       

      Site Definition under "Testing Server" 

      Access: FTP

      FTP host:  clientA.testingserver.com

      Host directory: /

      URL prefix: http://clientA.testingserver.com

      (location of the site's root folder on the testing server, the sub-domain redirection takes care of pointing to the sub-folder)

       

       

      This is just one solution but it works well for me as it doesn't have any cost associated with it under our hosting package where you can have multiple sub-domains setup.

       

      Hope this helps someone in a similar situation.

       

      Aly