When using @layout_set_friendly_url@ to generate a link in a web content article displayed on a page, if virtual host is set to "www.test.com" and you visit "test.com" instead, "/web/<sitename>" is added to the link. It is not present if you visit "www.test.com"
STEPS TO REPRODUCE
1. Define a structure with 1 text row and define a webcontent template with "<li><a href="@layout_set_friendly_url@$currentLayout.getFriendlyURL()" id="fmenu-link$count">$urlName</a></li>"
2. Add web content to the home page with the structure and template
3. In site settings, set public page virtual host to www.test.com.
4. Add to your hosts file a mapping from www.test.com and test.com to the ip address of the server.
5. Visit site with www.test.com:8080/. Link in web content shows up as: http://www.test.com:8080/$currentLayout.getFriendlyURL()
6. Visit site with test.com:8080. Link in web content shows up as: http://test.com:8080/web/guest/$currentLayout.getFriendlyURL()