How to Redirect Sitemap.xml to Your OSMap Sitemap

How to Redirect Sitemap.xml to Your OSMap Sitemap

OSMap is the most popular way to create a sitemap for Joomla sites.

In another tutorial, we showed you how to submit your sitemap to Google Search Console.

In this guide, I'm going to show you a more general way to allow any search engine to find your site. Some search engines will look for your sitemap at particular URL: Sitemaps work perfectly without using this URL, but redirecting sitemap.xml to your actual sitemap URL is one small step can make it easier for search engines. All that's needed is to copy the URL and add one line to your robots.txt file.

This tutorial will show you how to do that, step-by-step. 

You will need OSMap installed in order to follow this guide.

  • Go to Components > OSMap.
  • Right click the XML next to sitemap
  • Copy the link for your sitemap. 
  • Visit the sitemap link to confirm that everything is working correctly.

copy the xml sitemap link in OSMap

The next step will be to edit your site's robots.txt and add this sitemap. We use robots.txt because this file is designed to give useful information to search engines.

  • Access your host's file manager or use an FTP client to navigate to your Joomla root
  • Edit the robots.txt file
  • Insert the following code anywhere on a new line:
sitemap: [absoluteURL]

Delete [absoluteURL] and paste the URL of your sitemap instead.

Save the file and you're done! Now Google, Bing, Yahoo, and any other search engines will be able to find your sitemap.

Video introduction to OSMap

About the author

Nick is the Director of Support at Joomlashack and you can find him in almost every area of the site, from answering support requests and account questions to creating tutorials and software.