留言板

redirect parameter in URL

Patryk P,修改在12 年前。

redirect parameter in URL

New Member 帖子: 6 加入日期: 09-10-27 最近的帖子
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!
thumbnail
Hitoshi Ozawa,修改在12 年前。

RE: redirect parameter in URL

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
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
thumbnail
srikanth davuluri,修改在12 年前。

RE: redirect parameter in URL

Junior Member 帖子: 25 加入日期: 11-6-7 最近的帖子
Hi Hitoshi Ozawa

i am also facing same problem looking for URLs like below

ex: http://www.liferay.com/home to http://www.srikath.liferay.com

Thanks in advance..

regards
Srikanth Davuluri.
thumbnail
Samuel Kong,修改在12 年前。

RE: redirect parameter in URL

Liferay Legend 帖子: 1902 加入日期: 08-3-10 最近的帖子
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
Patryk P,修改在12 年前。

RE: redirect parameter in URL

New Member 帖子: 6 加入日期: 09-10-27 最近的帖子
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
thumbnail
Samuel Kong,修改在12 年前。

RE: redirect parameter in URL

Liferay Legend 帖子: 1902 加入日期: 08-3-10 最近的帖子
If you want to remove the redirect parameter, you will need to create a JSP Hook and modify the JSP pages.
Patryk P,修改在12 年前。

RE: redirect parameter in URL (答复)

New Member 帖子: 6 加入日期: 09-10-27 最近的帖子
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);
thumbnail
Amit Doshi,修改在10 年前。

RE: redirect parameter in URL

Liferay Master 帖子: 550 加入日期: 10-12-29 最近的帖子
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.
thumbnail
Dhrutika Vyas,修改在10 年前。

RE: redirect parameter in URL

Expert 帖子: 435 加入日期: 09-2-9 最近的帖子
Hi Amit,

You may need to overwrite xml file for this. Look into below thread.

http://www.liferay.com/community/forums/-/message_boards/message/8177475

Regards,
Dhruitka