i'm trying to follow this tutorial to start with 4d server web. http://doc.4d.com/4Dv16/4D/16/Serveur-Web.200-3246839.fe.html
i've disabled the default homepage index.html (and even deleted the actual file in the WebFolder folder) and then added these few lines on the On Web Connection method
C_TEXT($1)
Case of
:($1="/")
WEB SEND FILE("new_index.html")
End case
but still i get the 4d default page when i go to localhost:8080/ i then found out the method isn't even called unless i add something to the url (like localhost:8080/something)
If you have index.html listed in the database settings as the default home page then it will load that page (and sometimes it will create it if it does not exist).
Furthermore, using an html extension will not run any dynamic code, to invoke code you must either use an shtml extension or the file must not exist (OWA/OWC is triggered when the file is not found).
This tech tip still applies and gives a good rundown of in what situations the On Web Connection (and On Web Authentication) methods run:
Tech Tip: How to skip over HTTP and redirect to HTTPS: Part 2 (The Web decoy folder)
Quote:
So, If you want the / url to run your code you could use either of these approaches:
When modifying the Web Configuration options in 4D, the User Settings will take precedence over the Database Settings.
if User Settings are enabled, make sure to check both User Settings and Database Settings.
The user settings are accessible under the following menu options:
or