Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include static sitemap in Liferay

I'm in need of putting a static sitemap.xml file, because Liferay does not generate all of the desired links, and a few that shouldn't be there. I think it's because it's heavily altered by my ext-plugin.

Question is, that is it possible to set up a static sitemap.xml(used by google robots) in the portal root, not being changed by Liferay itself?

Using: Liferay 6.0.6

Thanks in advance :)

like image 363
Cornelius Avatar asked Oct 29 '12 15:10

Cornelius


2 Answers

A solution would be to add your static sitemap to the Liferay Document Library, and then tell Google the sitemap URL using Google's Webmaster Tools.

A second solution would be to add the sitemap to your ROOT directory (if you're using Tomcat), however this may require some changes to Tomcat settings and Liferay code.

Another solution is to create a portlet that generates all the links you want into an XML sitemap, and then save that file to a location of your choose. This is the approach I have taken as I needed to out put full article URLs which don't actually exist as pages.

like image 138
Jonny Avatar answered Nov 04 '22 07:11

Jonny


The best solution was to create a SitemapServlet class in Liferay (as suggested by Johnny) which responses with the sitemap file. No changes in Tomcat were needed.

like image 2
Cornelius Avatar answered Nov 04 '22 08:11

Cornelius