Print this page

How to fix the homepage URL in XMap sitemap

Written by

XMap is an excellent plugin for Joomla which dynamically generates both an HTML and an XML sitemap for your website. However, it has a problem where the homepage URL is not generated in a Search Engine Friendly way. Most people do not want their homepage URL to contain anything but the basic site URL (www.yoursite.co.uk), but XMap will always append the alias of the homepage menu item, for example www.yoursite.co.uk/home.html.

To fix this, open you will need to change the following two files in the XMap installation:

components/com_xmap/xmap.html.php
components/com_xmap/xmap.xml.php

Find the following line in both files:

$link = Xmap::getItemLink($node);

and add the following line immediately after:

$link = str_replace('/home.html', '/', $link);

You may need to clear the XMap cache via components->xmap->options in order to see the changes applied.

Alex

Alex is the founder / owner of Freshpage Web Design and has a wealth of experience across all levels of web development, including Java, SQL, HTML, CSS, PHP as well as content management systems such as Wordpress, Joomla and Magento.