KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Redirecting web users based on the URL with GET HTTP HEADER
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: August 22, 2007
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

By using the GET HTTP HEADER command in a database's On Web Connection method a developer can effectively run a website with different homepages for different groups of members. This is referred to as virtual hosting.

In this case the web server would use multiple different DNS names for only one IP address. Calling the GET HTTP HEADER command with the parameter "Host" returns the host name portion of the URL, which corresponds to the DNS name.

From here the developer can use the On Web Connection method to direct users accessing the website with different DNS names.

Note that the On Web Connection method is not called in the case of static web pages existing in a database's default HTML root folder.

For more on GET HTTP HEADER check the 4D online documentation:

https://www.4d.com/docs/CMU/CMU00697.HTM

For more on HTTP headers in general and the host header in specific check the RFC website:

https://www.rfc-editor.org/rfc/rfc4229.txt