Web Pages needs regular maintenance and update to keep them current and fresh. But, what if the current situation or lack of assets dictate that a current page cannot be taken down while a new one is being developed? What to do then?
Take the scenario where a second web server is not available, and the home page needs to be updated while the current home page remains available to the public. The example below demonstrates how to configure 4D to accomplish this task.
The first step it is to take control of serving the default home page from 4D and do it programmatically. To do this, the default home page must be removed from the Database Settings Web tab "Default Home Page" field. See the image below.
When a web page is listed as the "Default Home Page" in Database Settings 4D automatically serves this page upon initial request. The database method On Web Connection is never hit for the Home Page request. Removing the default home page from the Database Settings will force 4D to trigger the On Web Connection method for the home page request.
The code snippet shown below demonstrates how to continue to server a default Home Page to the public while serving one under development to the Localhost or a specified machine on the local area network.