Web Connection
REQUEST.GetVirtualPath() not working ?
Gravatar is a globally recognized avatar based on your email address. REQUEST.GetVirtualPath() not working ?
  Marcel DESMET
  All
  Jan 3, 2019 @ 11:56am

Hello, it seems that the REQUEST.GetVirtualPath() doesn't work on the web ( Webconnection 6.2 )

THIS.cVirtualPath = LOWER(REQUEST.GetVirtualPath())		
THIS.cServer = REQUEST.GetServerName()

It's ok on localhost

Gravatar is a globally recognized avatar based on your email address. re: REQUEST.GetVirtualPath() not working ?
  Rick Strahl
  Marcel DESMET
  Jan 3, 2019 @ 06:36pm

Are you running on IIS?

If not you have to set the Virtual= for each of the applications in the yourapp.ini file as most other Web servers don't provide the virtual base path info.

Gravatar is a globally recognized avatar based on your email address. re: REQUEST.GetVirtualPath() not working ?
  Marcel DESMET
  Rick Strahl
  Jan 4, 2019 @ 12:13am

Yes IIS on Windows Server 2012 for the Web and IIS on Win 10 for the localhost test

Gravatar is a globally recognized avatar based on your email address. re: REQUEST.GetVirtualPath() not working ?
  Rick Strahl
  Marcel DESMET
  Jan 4, 2019 @ 01:04am

Are you sure the URL is correct on the server? Your screen shot cuts off. You sure you didn't install the app into the root folder? In IIS the Application level node determines the virtual root of the application. Make sure it's an Application and not a Virtual in the IIS management console for the actual application sub-folder.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: REQUEST.GetVirtualPath() not working ?
  Marcel DESMET
  Rick Strahl
  Jan 4, 2019 @ 05:34am

Ok tks I misunderstand what a virtual path is but anyhow the way it works is not ok for my use.

Greenshop was setup manualy on the site level for the production Web Server so Greenshop is the root ( no virtual path.. ), on the dev computer the setup was done with the WC setup and created below the Default Web Site...

Gravatar is a globally recognized avatar based on your email address. re: REQUEST.GetVirtualPath() not working ?
  Rick Strahl
  Marcel DESMET
  Jan 4, 2019 @ 02:09pm

Not sure what you mean.

A virtual path is... well... a virtual path that depends on the Web site executing. It's not something you control, the Web Server determines the virtual once the application executes. For a root site the virtual path is / for a subsite it's /greenshop/ in your case.

If you built your application without hard coding root paths to your applcation (ie. using ~/somepage.wwd type links instead of /greenshoot/somepage.wwd) this all works transparently. This is something I highly recommend and mention in the docs. You should make your applications as movable as possible without having to refactor paths both in terms of OS paths and virtual paths.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: REQUEST.GetVirtualPath() not working ?
  Marcel DESMET
  Rick Strahl
  Jan 4, 2019 @ 03:47pm

My mistake was that I consider that the virtual path was the entry point of the site witch is correct on the dev machine installed with your setup

But this was not correct on the production server setup manually

So it's ok for me I use now REQUEST.GetServerName() to identify to calling web site

Gravatar is a globally recognized avatar based on your email address. re: REQUEST.GetVirtualPath() not working ?
  Rick Strahl
  Marcel DESMET
  Jan 4, 2019 @ 04:38pm

You can create an Application below your GreenShop Web site to get the virtual if you want to match your dev site which gives you http://greenshop.com/greenshop/ and /greenshop/ as the Virtual. I think that's what you're looking for? However, I think it's much better to be running at the root without a subvirtual as the entry point as you are doing now - it's just much cleaner.

FWIW, if you want to your dev setup to match you can also create a new Web site on your dev machine and add a site with a host header ie. bound to dev.greenshop.com. You can then add that domain into your HOSTS file and map it to 127.0.0.0. You then test your site with http://dev.greenshop.com and a virtual of / which will match both dev and live. Or you can just use IIS Express which generally runs under the root folder.

Lots of options... to do exactly what you want.

+++ Rick ---

© 1996-2019