Hi All
I have a problem with home page URL / friendly URL and I'll appreciate very much if anyone can give me some tips.
Our environment setup have site-name disabled.
So, in our preview site, the home page's URL is:
http://host:port/digital-site
and in live site, the home page's URL is: (note we disabled the site name)
http://host:port
Our problem is, we use the following code to generate a link to our home page:
Site site = rc.getCurrentSite();
Channel home = site.getHomeChannel();
link = getChannelLink(home, rc);
As a result, we can we run this code in preview and it generated correct link:
http://host:port/digital-site
But when we run the same code in live, since our site-name is disabled, so it
generated a non-FURL link:
http://host:port/portal/site/digital-site/menuitem.4a13298d2a4d1324642d30959d407ea0/?vgnextoid=e58180b3a346a210VgnVCM1000000100007fRCRD&vgnextchannel=82c180b3a346a210VgnVCM1000000100007fRCRD
And that link won't comply with our business requirement, it is absolutly
critical that a link to home page need to be readable.
I tried generat a Friendly URL to our home channel, which kind of solve the
problem, but not entirely.
So, I created the following FURL linked to our home channel:
/Home
And it worked, the following code:
Site site = rc.getCurrentSite();
Channel home = site.getHomeChannel();
link = getChannelLink(home, rc);
is smart enough to pick up the FURL form, http://host:port/Home, but that's
still not what we want. At end of the day we just want:
http://host:port
But I can't generate a friendly URL contain nothing. The system won't take a
FURL that is empty.
Is there a proper way to achieve this?
Thank you for your time.