Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Milan Kostoláni
Friendly URL problem
January 24, 2013 8:19 AM

Milan Kostoláni

Rank: Junior Member

Posts: 92

Join Date: July 26, 2012

Recent Posts

Hello everyone

Im having a problem to complete friendly URLs

the link looks like this

I tried this:

2    <route>
3        <pattern>/view/{value}</pattern>
4        <ignored-parameter name="p_p_id"/>
5        <implicit-parameter name="p_p_lifecycle">1</implicit-parameter>
6        <implicit-parameter name="javax.portlet.action">someAction</implicit-parameter>
7    </route>

also tried with {value:\d+}

However then it didnt work at all

Is there any solution for this?
Shashant Panwar
RE: Friendly URL problem
January 31, 2013 10:38 AM

Shashant Panwar

Rank: Junior Member

Posts: 28

Join Date: September 21, 2012

Recent Posts

Hi Milan,
Create a url-mapping.xml file in your resources.
Add the below entry in the file:

<?xml version="1.0"?>
<!DOCTYPE routes PUBLIC "-//Liferay//DTD Friendly URL Routes 6.1.0//EN" "">
<pattern>/{value}</pattern> ----- try without "/view/"
<implicit-parameter name="p_p_resource_id">your resource name</implicit-parameter>
<implicit-parameter name="p_p_lifecycle">2</implicit-parameter>
<implicit-parameter name="p_p_cacheability">cacheLevelPage</implicit-parameter>

Also,you need to add the below piece of code in your liferay-portlet.xml.
.....after icon
<friendly-url-mapping>your resource name which will map your url</friendly-url-mapping>
<friendly-url-routes>/urlMapping/you url-mapping.xml name</friendly-url-routes>

In my case,I created a resource,basically a hyperlink on which a new page with a friendly url.

I hope this will help.Good luck emoticon

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!