Welcome! Log In Create A New Profile

Advanced

WB24 - start homepage dynamically.

Posted by AadG 
WB24 - start homepage dynamically.
December 04, 2019 08:06PM
Hi all,

We have a Webde vsite with different starting pages. Every client has it's own startingpage.with specific information.
Can somebody think of a way to construct an URL, that chooses the right starting page ?

URL1 -> starts Page1
URL2 -> starts Page4
URL3 - > starts Page7
etc etc.

TIA for any information in the right direction.

Best regards,

Aad
Re: WB24 - start homepage dynamically.
December 04, 2019 10:12PM
Hey Aad,

Must the logon to the website?
Re: WB24 - start homepage dynamically.
December 04, 2019 10:24PM
Hi Jan,

What do you mean ? The logon page is the first page (companypage) and this is different for every client. It would be nice if one could extract the url, so we could work with subdomains.



Edited 1 time(s). Last edit at 12/04/2019 10:47PM by AadG.
Guest
Re: WB24 - start homepage dynamically.
December 05, 2019 08:11AM
I remember talking with Fabrice Harari a few years back about this and he's doing just that for his website (fabriceharari.com, wxshowrooom, etc, are all the same site)...

Too bad he's not answering on this forum anymore... You can perhaps ask him directly.

Argus
Re: WB24 - start homepage dynamically.
December 06, 2019 01:54PM
Hi Aad,

I think you need URL-rewrite to do that at a stage before webdev comes in.

I also see PageAdress() in the help. Maybe you can use that too redirect from a single Webdev-start-page to the required customers page.

Arie
Re: WB24 - start homepage dynamically.
December 06, 2019 02:23PM
Hi Arie,

Thank you for your suggestions. I can't see how to bring in PageAdress(). If I have a landingpage in my website, I still have to determine, what the clients URL is.

The only solution I came up with so far is to give every client it's own website in a designated map. In a subdomain I can put a index.html that points to the desgnated map i.e sub1.domain.nl points to the map domain.nl/sub1 in the index.html.

I hope you understand what I mean. Not the best solution but it works.

Best regards,

Aad
Re: WB24 - start homepage dynamically.
December 06, 2019 03:15PM
Hi Arie,

I found this in the Help : [help.windev.com]

It's about the function SysEnvironment(). There is something as a http_referrer. I don't have the knowledge to understand
this webstuff. Do you or someone else know anything about this ??


Best regards,

Aad
Re: WB24 - start homepage dynamically.
December 06, 2019 05:29PM
Yes SysEnvironment() seems to be better.

Try using a blank single homepage (AWP) and put this in de opening section to jump directly to a second page
SWITCH SysEnvironment("HTTP_REFERER")
CASE "url1"
PageDisplay(page1)
CASE "url1"
PageDisplay(page1)
OTHER CASE
PageDisplay(page_no_access)
END

Arie
Re: WB24 - start homepage dynamically.
December 07, 2019 03:46PM
Hi Arie,

I tried several configurations and browsers but HTTP_REFERER is empty. I tried several other environment variables and some of them work, some of them don't.

It would be a neat solution, but .............

Anyway, thanks for your help.


Best regards,

Aad



Edited 1 time(s). Last edit at 12/07/2019 03:47PM by AadG.
Re: WB24 - start homepage dynamically.
December 15, 2019 10:33PM
Hi Aad,

You need url rewriting in Webdev.
On the project tab choose Referencing, Configure the url rewriting.
Define it for the start page of your project.
Use / for the character separator, then click on the dots after the url and define a parameter name.
Then you can use Pageparameter in the page to determine the value of the parameter and go to the proper page.

Kind regards,
Piet
Re: WB24 - start homepage dynamically.
December 16, 2019 12:26PM
Aad


Define the procedures before opening the page and solve the problem.

If it is the same type of data then it works on the same page with the selection of users in the database



I have something similar

This site can be used by many different institutions and users

[ordinacija.info]

[infosonline.net]



Edited 2 time(s). Last edit at 12/16/2019 12:32PM by infos.
Re: WB24 - start homepage dynamically.
January 21, 2020 11:49AM
Hi Piet and Infos,

Sorry for the late reaction, but something came up. When I look at both your solutions, I don't think it's the solution I want
or it is a lack of Webdev knowledge on my part.

subdomain1.domain -> starts Page1
subdomain2.domain -> starts Page4
subdomain3.domain - > starts Page7

where subdomain is our clients name. Can this be done with your solutions.
It's a dynamic site, no AWP pages.

Best regards,

Aad
Re: WB24 - start homepage dynamically.
January 22, 2020 10:19AM
Hello Aad

What kind of clients are you talking about?
Can you give a more specific indication of what information you have in your database?

We can only speculate this way


In my case, I have different surgeries that have different jobs and different patients and it all revolves on the same page and in the same database. Each office only sees their information.

[infosonline.net]



Edited 1 time(s). Last edit at 01/22/2020 10:23AM by infos.
Re: WB24 - start homepage dynamically.
January 22, 2020 11:05AM
Ok, I will try to make it more clearly. The different subdomains are our customers, so Johnsonrealty.renting.com or Smithhousing.renting.com.
With Page1 I mean a landingpage for Johnsonrealty with their specific information as logo, address etc. With Page2 I mean a landingpage for Smithhousing with their specific information.

The subdomains can also be a normal domainname like SmithhousingOnline.com that starts Page2.

Every customer (our customer that is using our website) has it's own database, so there is only one website with several databases. Our customers have their clients, that are in the database.

What I want to achieve is, that when a customers client types i.e. Smithousing.rental.com, he automatically lands on the right page with the right associated database. There he can find al the infomation of his Association like financials, maintenance etc. etc)

We have a website for Home Owner Associations, where every association has it's own startingpage(landing). Every Association has it's own members. So when a member of HomeAssociationTulipsOfHolland.rental.com logs in with this URL, he automatically enters the page of Home Owners Association Tulips Of Holland.

I hope this is more clear.



Edited 3 time(s). Last edit at 01/22/2020 11:09AM by AadG.
pao
Re: WB24 - start homepage dynamically.
January 22, 2020 01:49PM
We have done something like that using the result of SysEnvironment("HTTP_HOST")
Our site is in windows server 2012R2 and we use the anonymous Autehtication

I don't know why you can't get results from SysEnvironment(), are you code in the Initializing the project after connection to the site?

Regards

Paulo Oliveira
Re: WB24 - start homepage dynamically.
January 22, 2020 02:03PM
Hi Paolo,

HTTP_Host gives the name of the server. We need HTTP_REFERER, that should return the URL.We put HTTP_REFERER on several places also Project Initialization but no value back.
Re: WB24 - start homepage dynamically.
January 23, 2020 04:31PM
Aad

What are the pages, if not secrets put a link (URL)

[infosonline.net]



Edited 1 time(s). Last edit at 01/23/2020 04:32PM by infos.
Re: WB24 - start homepage dynamically.
January 23, 2020 04:44PM
What die you mean with "What are the pages". Nothing special. Just a page with a logo and two inputfields for login.

I looked on the Windev forum of PCSoft and there is a thread about this.


Windev forum
Re: WB24 - start homepage dynamically.
January 24, 2020 04:09PM
Hi Aad,

You can still use an awp page to start the site and use DynamicSiteDisplay.to choose a landing page.
Create an awp page in your project and define a parameter for this page:
PROCEDURE PAGE_StartSite(sPageName)
In the onload code:
DynamicSiteDisplay("mysite",sPageName)

Then configure the url rewriting for PAGE_StartSite so you can enter www.mysite/company1 like I described in previous post.

Best regards,
Piet
Re: WB24 - start homepage dynamically.
January 29, 2020 01:55PM
Thanks Piet, I will look into it.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: