留言板
redirect parameter in URL
Hi there,
I can't find any way not to include redirect parameter in URL of my site.
The problem is:
* I have an asset publisher at the main page of my site. Let's say url: http://example.com/main/
* If I click in the "read more" link, the article gets presented under url:
http://example.com/main/-/asset_publisher/rI3r/content/article-title?redirect=http%3A%2F%2Fexample.com%2Fmain%3Fp_p_id%3D101_INSTANCE_rI3r%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D2
which is mess... Especially when I want to add Facebook like button which needs a permanent url (not changing depending on where you come from).
Can anyone help how to get rid of this?
thanks!
I can't find any way not to include redirect parameter in URL of my site.
The problem is:
* I have an asset publisher at the main page of my site. Let's say url: http://example.com/main/
* If I click in the "read more" link, the article gets presented under url:
http://example.com/main/-/asset_publisher/rI3r/content/article-title?redirect=http%3A%2F%2Fexample.com%2Fmain%3Fp_p_id%3D101_INSTANCE_rI3r%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D2
which is mess... Especially when I want to add Facebook like button which needs a permanent url (not changing depending on where you come from).
Can anyone help how to get rid of this?
thanks!
I'm not too sure if this is what you'll looking for.
http://www.liferay.com/community/wiki/-/wiki/Main/Friendly+URLs;jsessionid=69540A7AEBDC479F692C4C3464F49850.node-1
http://www.liferay.com/community/wiki/-/wiki/Main/FriendlyURLMapper
http://www.liferay.com/community/wiki/-/wiki/Main/Friendly+URLs;jsessionid=69540A7AEBDC479F692C4C3464F49850.node-1
http://www.liferay.com/community/wiki/-/wiki/Main/FriendlyURLMapper
The redirect parameter is optional and is only used for the "«Back" link. So for Facebook, you can just use
http://example.com/main/-/asset_publisher/rI3r/content/article-title
http://example.com/main/-/asset_publisher/rI3r/content/article-title
Hitoshi, Samuel - thanks for replies.
Samuel got it right. I'm glad it's optional. How to disable it?
The problem is I don't want this redirect parameter in url. If you use Facebook FBML it gets url of current page (you don't specify it explicitly). And it happens that you get to the specific article from different places, and thus have different urls for the same article (different redirect parameter values).
So it ends up that for the article you get:
5 FB likes for this url:
http://example.com/main/-/asset_publisher/rI3r/content/article-title?redirect=http%3A%2F%2Fexample.com%2Fmain%3Fp_p_id%3D101_INSTANCE_rI3r%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D2
7 FB likes for this url:
http://example.com/main/-/asset_publisher/rI3r/content/article-title?redirect=http%3A%2F%2Fexample.com%2F__OTHERSOURCE__%3Fp_p_id%3D101_INSTANCE_rI3r%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D2
When you SHOULD get 12 FB likes for this url:
http://example.com/main/-/asset_publisher/rI3r/content/article-title
Samuel got it right. I'm glad it's optional. How to disable it?
The problem is I don't want this redirect parameter in url. If you use Facebook FBML it gets url of current page (you don't specify it explicitly). And it happens that you get to the specific article from different places, and thus have different urls for the same article (different redirect parameter values).
So it ends up that for the article you get:
5 FB likes for this url:
http://example.com/main/-/asset_publisher/rI3r/content/article-title?redirect=http%3A%2F%2Fexample.com%2Fmain%3Fp_p_id%3D101_INSTANCE_rI3r%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D2
7 FB likes for this url:
http://example.com/main/-/asset_publisher/rI3r/content/article-title?redirect=http%3A%2F%2Fexample.com%2F__OTHERSOURCE__%3Fp_p_id%3D101_INSTANCE_rI3r%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D2
When you SHOULD get 12 FB likes for this url:
http://example.com/main/-/asset_publisher/rI3r/content/article-title
If you want to remove the redirect parameter, you will need to create a JSP Hook and modify the JSP pages.
Thanks for your help!
For those who would like to do the same thing, you need to override:
html\portlet\asset_publisher\abstracts.jsp
the function that adds redirect parameter is called _checkViewURL() so you need to comment out the line:
viewURL = _checkViewURL(viewURL, currentURL, themeDisplay);
For those who would like to do the same thing, you need to override:
html\portlet\asset_publisher\abstracts.jsp
the function that adds redirect parameter is called _checkViewURL() so you need to comment out the line:
viewURL = _checkViewURL(viewURL, currentURL, themeDisplay);
Hi All,
Sorry to dig into old thread, but I am facing similar issue.
My URL is
http://localhost:8083/web/guest/home/-/asset_publisher/Yxf9G3NnredU/document/id/79431?redirect=http%3A%2F%2Flocalhost%3A8083%2Fweb%2Fguest%2Fhome%3Fp_p_id%3D101_INSTANCE_Yxf9G3NnredU%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D1
I want to remove extra parameter from the url, I want to make it as
http://localhost:8083/web/guest/home/-/asset_publisher/Yxf9G3NnredU/document/id/79431?redirect=http%3A%2F%2Flocalhost%3A8083%2Fweb%2Fguest%2Fhome,
I like to remove below parameters.
p_p_col_id
p_p_col_count
p_p_mode
p_p_state
p_p_lifecycle
I am ready to go into the EXT but I don't know what pattern I should write in the asset-publisher-friendly-url-routes.xml
Any help would be great
Thanks & Regards,
Amit D.
Sorry to dig into old thread, but I am facing similar issue.
My URL is
http://localhost:8083/web/guest/home/-/asset_publisher/Yxf9G3NnredU/document/id/79431?redirect=http%3A%2F%2Flocalhost%3A8083%2Fweb%2Fguest%2Fhome%3Fp_p_id%3D101_INSTANCE_Yxf9G3NnredU%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-1%26p_p_col_count%3D1
I want to remove extra parameter from the url, I want to make it as
http://localhost:8083/web/guest/home/-/asset_publisher/Yxf9G3NnredU/document/id/79431?redirect=http%3A%2F%2Flocalhost%3A8083%2Fweb%2Fguest%2Fhome,
I like to remove below parameters.
p_p_col_id
p_p_col_count
p_p_mode
p_p_state
p_p_lifecycle
I am ready to go into the EXT but I don't know what pattern I should write in the asset-publisher-friendly-url-routes.xml
Any help would be great
Thanks & Regards,
Amit D.