Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Liferay portal not being seen by search engines. Brant Levinson July 12, 2008 1:11 PM
RE: Liferay portal not being seen by search engines. Brant Levinson July 12, 2008 8:22 PM
Redirecting Milan Jaroš August 18, 2008 6:16 AM
Re: [Liferay Forums][2. Using Liferay] Redirecting Brant Levinson August 19, 2008 4:49 AM
RE: Redirecting Fuad Efendi October 2, 2008 12:05 PM
RE: Liferay portal not being seen by search engines. JR Houn July 16, 2008 3:30 PM
RE: Liferay portal not being seen by search engines. Fuad Efendi July 16, 2008 3:42 PM
RE: Liferay portal not being seen by search engines. Not Me July 17, 2008 6:57 AM
RE: Liferay portal not being seen by search engines. Fuad Efendi July 17, 2008 1:39 PM
RE: Liferay portal not being seen by search engines. Not Me July 21, 2008 5:57 AM
RE: Liferay portal not being seen by search engines. Sergio Exequiel Sánchez July 28, 2008 12:49 PM
RE: Liferay portal not being seen by search engines. Not Me July 28, 2008 2:23 PM
RE: Liferay portal not being seen by search engines. Fuad Efendi August 6, 2008 3:13 PM
RE: Liferay portal not being seen by search engines. Ton Hoang February 10, 2009 9:19 AM
RE: Liferay portal not being seen by search engines. Not Me August 4, 2008 11:42 AM
RE: Liferay portal not being seen by search engines. Fuad Efendi August 6, 2008 2:57 PM
RE: Liferay portal not being seen by search engines. Not Me August 7, 2008 6:30 AM
RE: Liferay portal not being seen by search engines. Ton Hoang February 11, 2009 6:41 PM
RE: Liferay portal not being seen by search engines. Fuad Efendi February 15, 2009 6:57 AM
RE: Liferay portal not being seen by search engines. Milan Jaroš March 24, 2009 11:56 AM
RE: Liferay portal not being seen by search engines. Fuad Efendi October 14, 2009 9:39 AM
RE: Liferay portal not being seen by search engines. Nigel Jones August 7, 2013 1:51 AM
Brant Levinson
Liferay portal not being seen by search engines.
July 12, 2008 1:11 PM
Answer

Brant Levinson

Rank: Junior Member

Posts: 48

Join Date: July 12, 2008

Recent Posts

It seems the portal isn't set up to been seen accurately with search engines. I was trying to look at my site and no metadata was been picked up so I checked liferay.com itself and it has the same problem. This is an urgent issue. Please examine:

http://www.seo-browser.com/index.php?address=http%3A%2F%2Fwww.liferay.com&action=Parse+URL

It also doesn't pass w3c validity (above is most important):

http://validator.w3.org/check?uri=http://www.liferay.com
Brant Levinson
RE: Liferay portal not being seen by search engines.
July 12, 2008 8:22 PM
Answer

Brant Levinson

Rank: Junior Member

Posts: 48

Join Date: July 12, 2008

Recent Posts

Putting the following code in ROOT/index.jsp seems to work well:

<jsp:forward page="<%= PortalUtil.getPathMain() %>"/>

This replaces the <meta content="0; url=<%= PortalUtil.getPathMain() %>" http-equiv="refresh" />

Brant
JR Houn
RE: Liferay portal not being seen by search engines.
July 16, 2008 3:30 PM
Answer

JR Houn

LIFERAY STAFF

Rank: Expert

Posts: 489

Join Date: November 19, 2007

Recent Posts

I've never used the w3 website validator until I saw you link it here. Interestingly enough a lot of my favorite sites do not validate against the w3's standards - www.cnn.com, www.digg.com, www.sun.com, www.google.com.
-jr
Fuad Efendi
RE: Liferay portal not being seen by search engines.
July 16, 2008 3:42 PM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 171

Join Date: April 5, 2007

Recent Posts

Do not worry, www.microsoft.com do not pass validation too... avoid extremely stupid things for better indexing such as unbalanced tags (anchor text):
<a href="/n/p/p/7359988/c/396.html">etnies</p><p class="name">Tartan Custom Zip Hoodie</a></p>

Google uses HTML hacks to show 'cached' content, and it still works with modern browsers (they put tag right before scraped , , and )

I worked 7 weeks on http://wheretogo.lavalife.com last year (November-December, Liferay 4.3.*), and in January it already had Google Toolbar PageRank 5.
Not Me
RE: Liferay portal not being seen by search engines.
July 17, 2008 6:57 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Hi Fuad,

I noticed that the site has kind of friendly URLs with Journal Contents, am I wrong?

http://wheretogo.lavalife.com/web/go/toronto/restaurants/journal_content/56/10502/11292/FEATURED-BUSINESS-PROFILE

How did you handle it? I mean, it is not out of the box, isn't it?

Thanks in advance,
Mariano.
Fuad Efendi
RE: Liferay portal not being seen by search engines.
July 17, 2008 1:39 PM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 171

Join Date: April 5, 2007

Recent Posts

Mariano Cifre:
Hi Fuad,

I noticed that the site has kind of friendly URLs with Journal Contents, am I wrong?

http://wheretogo.lavalife.com/web/go/toronto/restaurants/journal_content/56/10502/11292/FEATURED-BUSINESS-PROFILE

How did you handle it? I mean, it is not out of the box, isn't it?

Thanks in advance,
Mariano.


Wheretogo still uses default JournalContentFriendlyURLMapper provided by Lifaray... Unfortunately it was short-term project (7-weeks from-scratch) so that not-so-SE-friendly (I don't have dynamic Title, Description, etc.)

Click Magazine will have (soon) URLs like
...dating/feature/article/Cuke-or-Carrot-What-Veg-Are-You/rHSA/11405/p1

- just modify slightly JournalContentFriendlyURLMapper.

Fortunately JSPs are executed before Theme (portal.vm template) so that we can store in a request attribute some metatags for SE and users which then will be picked by Theme.

For SEO:

PortalUtil.setPageSubtitle(articleDisplay.getTitle(), request);
request.setAttribute("lavalife-article-description", articleDisplayDescription.getContent());
request.setAttribute("lavalife-article-keywords", articleDisplayKeywords.getContent());



Theme (init_custom.vm):

#if ($pageSubtitle)
#set ($the_title = $pageSubtitle + " - " + $the_title)
#end

#set ($articleDescription = $request.getAttribute("lavalife-article-description"))
#set ($articleKeywords = $request.getAttribute("lavalife-article-keywords"))

#if ($articleDescription)
#set ($description = $articleDescription)
#end

#if ($articleKeywords)
#set ($keywords = $articleKeywords)
#end
Not Me
RE: Liferay portal not being seen by search engines.
July 21, 2008 5:57 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Hi Fuad,

Thanks so much for such a detailed explanation... It really helps me a lot!

Thanks!!!
Mariano.
Sergio Exequiel Sánchez
RE: Liferay portal not being seen by search engines.
July 28, 2008 12:49 PM
Answer

Sergio Exequiel Sánchez

Rank: New Member

Posts: 2

Join Date: July 4, 2008

Recent Posts

Fuad Efendi:
[Wheretogo still uses default JournalContentFriendlyURLMapper provided by Lifaray... Unfortunately it was short-term project (7-weeks from-scratch) so that not-so-SE-friendly (I don't have dynamic Title, Description, etc.)


Hi Fuad,

Which Portlet do you use to generate the Journal Content list that allows you to use the Friendly Url?
Are you using / extending the Asset Portlet, a Journal Content with a specific template or a custom one?

Thanks in advance,
Sergio.
Not Me
RE: Liferay portal not being seen by search engines.
July 28, 2008 2:23 PM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Hi Sergio,

It is out of the box with Liferay. Take a look at this article:
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Journal%20Internal%20API

HTH,
Mariano.
Not Me
RE: Liferay portal not being seen by search engines.
August 4, 2008 11:42 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Hi Fuad!

I am trying to do what you suggested.

Fuad Efendi:
For SEO:

PortalUtil.setPageSubtitle(articleDisplay.getTitle(), request);
request.setAttribute("lavalife-article-description", articleDisplayDescription.getContent());
request.setAttribute("lavalife-article-keywords", articleDisplayKeywords.getContent());


I was able to get the articleDisplayDescription using articleDisplay.getDescription().

How did you get articleDisplayKeywords?

We have added in the structure another field named "keywords", but I can't find the way to get that text using the articleDisplay.

Any help would be greatly appreciated!

Thanks,
Mariano.
Fuad Efendi
RE: Liferay portal not being seen by search engines.
August 6, 2008 2:57 PM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 171

Join Date: April 5, 2007

Recent Posts

Mariano Cifre:
Hi Fuad!

I was able to get the articleDisplayDescription using articleDisplay.getDescription().

How did you get articleDisplayKeywords?

We have added in the structure another field named "keywords", but I can't find the way to get that text using the articleDisplay.




And the trick is... either use XPATH & JournalArticle.getContent(), or allow Liferay to do via cached ArticleDisplay & Template:

articleDisplayDescription = JournalContentUtil.getDisplay(portletGroupId, request.getParameter("articleId"), "T-CMA-DESCRIPTION", LanguageUtil.getLanguageId(request), themeDisplay);
articleDisplayKeywords = JournalContentUtil.getDisplay(portletGroupId, request.getParameter("articleId"), "T-CMA-KEYWORDS", LanguageUtil.getLanguageId(request), themeDisplay);


It is possible to retrieve article fields by using templates; it is even faster because it uses caching (& higher-level-API) provided by Liferay instead of explicit XPATH, here is full "T-CMA-KEYWORDS" template (do not forget XML-escaping!):

#if ($Keywords.data) $htmlUtil.escape($Keywords.getData()) #end
- I have 'Keywords' in a structure. I extended Journal Content portlet, it has 'Allow Dynamic Metatags' checkbox so that only one 'child' (article) should manage 'parent' (theme) (page may contain several articles)
Fuad Efendi
RE: Liferay portal not being seen by search engines.
August 6, 2008 3:13 PM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 171

Join Date: April 5, 2007

Recent Posts

Sergio Exequiel Sánchez:
Which Portlet do you use to generate the Journal Content list that allows you to use the Friendly Url?
Are you using / extending the Asset Portlet, a Journal Content with a specific template or a custom one?


I am currently using extended version of Asset Publisher with explicit hard-coded URLs (constructed explicitly for each article)... it's hard to automate it. It's easy if you have single instance of portlet on a page, or when you do not worry about WindowState.MAXIMIZED etc...

In my specific scenario (different project) I have several Asset Publishers and several Journal Content portlets on the same page, and clicking link on Asset Publisher should change content of Journal Article on the same page!

It looks like /....../myPage/journal_content/SEO-FRIENDLY-ARTICLE-TITLE/56_INSTANCE_aBcD/1234/5678

- and there is no way to avoid aBcD, although we may have SEO-friendly title in URL.
/....../myPage is just a page, and the rest is portletRequest parameters. I don't know better solution yet... we can hardcode some mapping probably, and encode 56_INSTANCE_aBcD somehow.

Interportlet communications when we have several portlets on a single page with WindowState.NORMAL, via SEO-friendly URLs, - we need to know portlet IDs and hardcode it somehow...
Not Me
RE: Liferay portal not being seen by search engines.
August 7, 2008 6:30 AM
Answer

Not Me

Rank: Junior Member

Posts: 90

Join Date: May 27, 2008

Recent Posts

Fuad,

Thank you so much for your super-smart solution!!!

Very clever, indeed...

Thanks!
Mariano.
Milan Jaroš
Redirecting
August 18, 2008 6:16 AM
Answer

Milan Jaroš

Rank: Expert

Posts: 269

Join Date: August 18, 2008

Recent Posts

Brant Levinson:
Putting the following code in ROOT/index.jsp seems to work well:

<jsp:forward page="<%= PortalUtil.getPathMain() %>"/>

This replaces the <meta content="0; url=<%= PortalUtil.getPathMain() %>" http-equiv="refresh" />

Brant

Hello,
I'm interested in why isn't this implemented yet? Or better? If person or robot visits site browser is 3 times redirected. It's silly, isn't it:
1) User asks for SITE through browser and browser ask server.
2) Server send page which contains meta-refresh from SITE to .
3) Browser than tell server he want SITE/c and server response this page is in other place for now (HTTP/1.x 302 Moved Temporarily) and say go to SITE/c/portal/layout of course it should be different if user is logged in...
4) Browser than ask for that page but server says go to SITE/welcome (HTTP/1.x 302 Moved Temporarily again).
5) Browser finally ask and get wanted page.

Is here any solution to solve this in index.jsp or somehow? I of course don't know Liferay's sources for now. But I wish there will be implemented one Permanent redirection (mainly because of SEO) to that page which user or robot wants to get.

With regards,
Milan Jaros.
Brant Levinson
Re: [Liferay Forums][2. Using Liferay] Redirecting
August 19, 2008 4:49 AM
Answer

Brant Levinson

Rank: Junior Member

Posts: 48

Join Date: July 12, 2008

Recent Posts

That was my point, I've haven't seen movement on this thus far. Doing what I did seemed to fixed the issue, maybe we should put that as a enhancement request as it's seems to work better for SEO.
Fuad Efendi
RE: Redirecting
October 2, 2008 12:05 PM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 171

Join Date: April 5, 2007

Recent Posts

Milan Jaroš:
Brant Levinson:
Putting the following code in ROOT/index.jsp seems to work well:

<jsp:forward page="<%= PortalUtil.getPathMain() %>"/>

This replaces the <meta content="0; url=<%= PortalUtil.getPathMain() %>" http-equiv="refresh" />

Brant

Hello,
I'm interested in why isn't this implemented yet? Or better? If person or robot visits site browser is 3 times redirected. It's silly, isn't it:


No any redirects after assigning virtual host to community. Check Click Magazine using Mozilla Firefox with Live HTTP Headers plugin. Correct and best-by-performance responses with 200, 304, gzip.

Some redirects are needed if your browser do not support cookies: for session tracking. "Forward" can't assign session!
Ton Hoang
RE: Liferay portal not being seen by search engines.
February 10, 2009 9:19 AM
Answer

Ton Hoang

Rank: New Member

Posts: 21

Join Date: December 9, 2008

Recent Posts

thank for your thread reply,

did you sucessfull done with SEO as you tell? thank if you have more detail
Ton Hoang
RE: Liferay portal not being seen by search engines.
February 11, 2009 6:41 PM
Answer

Ton Hoang

Rank: New Member

Posts: 21

Join Date: December 9, 2008

Recent Posts


PortalUtil.setPageSubtitle(articleDisplay.getTitle(), request);
request.setAttribute("lavalife-article-description", articleDisplayDescription.getContent());
request.setAttribute("lavalife-article-keywords", articleDisplayKeywords.getContent());

what file to put above code Fuad ?
Fuad Efendi
RE: Liferay portal not being seen by search engines.
February 15, 2009 6:57 AM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 171

Join Date: April 5, 2007

Recent Posts

Just to finalize FriendlyURL-related staff.
1. Create new JournalContentExt portlet and mark it as
1    <instanceable>false</instanceable>

- it will help to avoid weird "56_INSTANCE_aWyQ" in friendly URLs

2. Have proper implementation of
1FriendlyURLMapper


3. Create a page "MyPage" with single instance of JournalContentExt

4. Use following code in your JSPs to generate friendly URLs to your Journal Atricles:
 1<%
 2     ResourceURL articleURL = null;
 3     long targetLayoutPlid = PortalUtil
 4          .getPlidFromFriendlyURL(MyGuestCommunityID, "/web/guest/MyPage");
 5     articleURL = new PortletURLImpl(request, "JournalContentExt",
 6          targetLayoutPlid, PortletRequest.RENDER_PHASE);
 7     articleURL .setParameter("groupId", ...);
 8     articleURL .setParameter("articleId", ...);
 9     articleURL .setParameter("templated", ...);
10     ...
11%>
12<a href=”<%= articleURL.toString() %>">My Article</a>

- it will generate Friendly URL to your article. If you mapped guest community to virtual host/DNS it will remove /web/guest prefix.

P.S.
Unfortunately, <liferay:portletURL> can't deal with targetLayoutPlid yet... so explicit Java is used instead of JSP tag (if you need to create link to another page)
Milan Jaroš
RE: Liferay portal not being seen by search engines.
March 24, 2009 11:56 AM
Answer

Milan Jaroš

Rank: Expert

Posts: 269

Join Date: August 18, 2008

Recent Posts

I was reading through. So you have a lot of good ideas! But it seems that nothing is totally clean and ready-to-use. I mean it will be great if this should be implemented into Liferay directly without any working around. Can you post your ideas into Jira? Thank you.
With regards,
Milan.
Fuad Efendi
RE: Liferay portal not being seen by search engines.
October 14, 2009 9:39 AM
Answer

Fuad Efendi

Rank: Regular Member

Posts: 171

Join Date: April 5, 2007

Recent Posts

I can't be implemented directly. Developers must manage friendly URLs (including generation of standard characters and replacement of special). Developers may choose for instance to have unique Article Name and enforce it via Java API - SQL-triggers, in order to avoid Article ID in URLs. Depends on use case...


Here are some samples from my recent project. Note that I have specific implementation for tagged content search:

http://www.casaguru.com/search/-/a/t/colour%20consultation/
http://www.casaguru.com/search/-/a/t/cottages/

http://www.casaguru.com/a/-/j/186958/Karens-Cottage-Make-Over-Planning-Step-Two

http://www.casaguru.com/p/-/p/153726/Michael-Lloyd-Invis-on-the-Peninsula

http://www.casaguru.com/p/-/p/572765/Waters-Mackie-Valuations-Inc-Sylvan-Lake

http://www.casaguru.com/o/-/o/56788/Saskatchewan-Association-of-Architects

Additionally, sitemap.xml is automatically generated.


...and my profile http://www.linkedin.com/in/liferay - available now, Canada & USA. I am also expert in Lucene, Hadoop, MapReduce, Cascading, SOLR, etc.
Nigel Jones
RE: Liferay portal not being seen by search engines.
August 7, 2013 1:51 AM
Answer

Nigel Jones

Rank: New Member

Posts: 1

Join Date: August 7, 2013

Recent Posts

I think you need a good search marketer to help, I do much work for a ukrainian personals site and have good results.