This article documents how the Liferay platform will automatically generate URLs appended with /web/, which can also be changed to a friendly URL. This may be an issue for those who do not want to append generated endings to URLs.
For instance: http://liferay.com/web/page.html becomes http://liferay.com/page.html
Resolution
URL rewrites and redirection must be configured on the Web Server directly. One example to resolve this issue is by adding the following portal property:
- In Liferay Portal 6.1 EE and above:
virtual.hosts.default.site.name=Guest - In Liferay Portal 6.0 EE and below:
virtual.hosts.default.community.name=Guest
Please note that localhost will not work with this property, so in a test environment the hosts file must be redirected to something other than localhost.
If you prefer to do this through the portal here are the alternative steps:
-
Control Panel-> Site Settings -> Site URL
- As an example, from here you can set the virtual host to say something like, www.test.com
- If testing this locally, you will need to navigate to
hosts.txtinC:\Windows\System32\drivers\etcand add to the bottom line127.0.0.1 www.test.com- Make sure to remove it when testing is complete
- Site URLs should now show up as www.test.com/page1/2/3/etc. for that site
Additional Information
If you wish to keep a naming scheme, you can use the friendly URL that will change the /guest portion. Or if you are using a virtual host and desire to incorporate a naming scheme you can manage the page URLs individually by clicking manage page while on the page.