Sitemap

Amicuk Programming Answers

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

2015-10-11   Views:0

Advertisement

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

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

The replay answer
Advertisement
Just Google it, or run out and buy a copy of David Powers' Foundations Dreamweaver CS4 with CSS, Ajax and PHP, a book that is never out of reach for me.  He details the process explicitly for both Mac and PC.
For me, on W7, I edit the C:/Windows/System32/drivers/etc/hosts file, and add the ip of my testing server along with the site alias -
192.168.1.82  site.local
Then I add this same designation to my httpd.conf file in Apache on the testing server.  Finally I restart Apache.
Now from my production machine if I browse to "http://site.local", I get to see either the default file in the root of the site on the testing server, or a directory of the site on the testing server (my testing server is a unix box running on my LAN at that ip address).  Furthermore, all of my root relative links now work as they would if the pages were being browsed from the live server.

Go to See the other 6 answers

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

Category:DefaultRelease time:2015-10-11Views:130

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[More]

Dreamweaver local site root no longer recognized after Leopard installation

Category:DefaultRelease time:2015-10-11Views:130

Hi, After installing Leopard, my Dreamweaver CS3 local site root is no longer available, although files and folders still exist in it. Any suggestions? Thanks!You can reconnect the local root folder to the site from within Dreamweaver.Read other 2 an[More]

How to make site root-relative links work in DW and Server both?

Category:DefaultRelease time:2015-10-11Views:130

See details on buggy DW image link behavior, below. My question is: 1) how to make site root-relative links work in DW and Server both? Or… 2) how to reliably automate the change of several hundred legacy root-relative links of the form /images/image[More]

Link to site-root relative style sheet not working CS4

Category:DefaultRelease time:2015-10-11Views:130

I am trying to define links to site-root relative external style sheets - as I believe that IE conditional comments prevent Templates from correctly updating the links. The styles are not being applied when I use any href path begining with "/".[More]

How do you change Site/Root Folder?

Category:DefaultRelease time:-0001-11-30Views:130

How do you change Site/Root Folder? I have looked for ages, but i can't find how to change the root folder, it keeps trying to put everything in my first websites folder. Please Help.> it keeps trying to put everything in my first websites folder whe[More]

Moving a site with links relative to site root

Category:DefaultRelease time:-0001-11-30Views:130

hi: we have a dedicated server (Linux, Apache) with several virtual hosts: /vhost/site01/home/html/ /vhost/site02/home/html/ now, i need to add some sites (developed by other people and working in their own servers) as "microsites" inside site01[More]

Site root links problem in Dreamweaver CS3

Category:DefaultRelease time:-0001-11-30Views:130

I am having trouble with links relative to site root when I work on my localhost with Dreamweaver CS3. I am building a site with PHP, MySQL using the WAMP server. I have a page ( www.site.com/index.php ) that I want to copy to sub-directories (e.g. w[More]

Steps to Transfer mail from Older MBP 10.6.8 to Newer MBP 10.8.5 for NON-tech person  I really just need the simplest solution.  I have cleaned out old folders on the OMBP, but there are folders I need for work

Category:DefaultRelease time:-0001-11-30Views:130

I really just need the simplest solution.  I have cleaned out old folders on the OMBP, but there are folders I need for work. I am not a technical person.  I have gone online and read a gazillion "All Ya Gotta Do...." to the point where my head[More]

No phonegap.js on site root and other problems building apps with phonegap

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, I'm starting to develop some apps with dw cs5.5 but I encounter several problems here. I just installed the Jquery mobile update (using the official adobe extension) and now every new project I start (using the mobile + phonegap template) I s[More]

Hi Apple I faced problem no (1) I try all solution form Apple sit But the problem still Unsolved

Category:DefaultRelease time:-0001-11-30Views:130

hi Apple I faced problem no (1) I try all solution form Apple sit But the problem still UnsolvedI understand that. But what exactly have you tried and what were the results when you did? Perhaps it would be better if you posted in your native languag[More]

Dreamweaver CC won't let me import my site root folder/content?

Category:DefaultRelease time:-0001-11-30Views:130

It's saying I must define a remote server first? This has never happened to me. I'm usually able to import my folder, and start working on my site.hummingbirdz wrote: For now, I'm going to preview using a temporary file. And ask my teacher to help me[More]

Hot
On my old laptop I backed up my music on to an external hard drive ready to transfer over to my new laptop. After copying the folder from my external to the new laptops' own drive, I duly followed instructions to restore the library. I thought all wa [More]
Hi all, I am developing a Dynamic ALV report where I want display material batch (zjpack_base-charg) in column and Material (zjpack_base-matnr) & Qty (Zjpack_base-netwr) field row wise.My intention is to show report datewise for a material how many b [More]
Hello, I am new to the forums, and would like some help. My set up is as follows: 2010 Mac Pro 2x2.4 Quad-Core Intel Xeon - Running Lion 12GB 1066 MHz DDR3 2TB HD ATI Radeon HD 5770 1024 MB Graphics Displays: 27" LED Cinema Display 24" Acer HD M [More]
Hello, I am considering purchasing a AirPort Extreme.  I am wondering if I can stream the content saved on the hard drive through Apple TV? Thanks.Do you have a hacked (JB is term used here).. atv1 or atv2 the answer is yes.. If you have a standard A [More]
Hi, i'm having some troubles with PCManFM. Every time i want to open the file manager it just doesn't do anything, no errors and no feedback if i run it from a console. If i create a folder on my desktop and double click on it, file manager will pop [More]
Hello! I am trying to style my links for this PDF document. They should signal "go forward" or "more information here" in the simplest, most minimalistic manner. Now, I know I've seen symbols like these before, I just can't for the lif [More]
Hello I have files which i need to take to work tomorrow on my computer at home.  I don't have a USB flash drive and wish to use my iPhone 3GS to achieve this simple task.  What I have in mind is allocating, say, 4GB of space to store files on and be [More]
Quicktime Pro registered but not letting me edit filesThe files are mov. And I just discovered that "some" mov may be edited, but not all I have. What's the difference? The files are not "read only".Read other 4 answers [More]
Does it contain EP or is EP different ..? Its same right? I can see the portal... Pls comment since i am not sure whats diff between 2004 and 2004s? For webflow there is a PDF in the doc folder of installation .It ask to add  SAP CAF GP role to execu [More]
My CC desktop application will not update to version 1.6.0.393.  I click on it to update, it downloads thru 100% and leaves the screen.  I can see disk activity and hear the cooling fan kick in but nothing happens.  After an hour or so I try to start [More]