The Opencart XML Sitemap file (sitemap) is not physically stored anywhere; usually, the Sitemap is automatically generated using a special route that creates an XML sitemap when a specific URL is accessed. To get a sitemap in OpenCart, you can follow these steps:
Enabling a sitemap in the admin panel
- Go to your OpenCart admin panel .
- Go to the Extensions section.
- In the Extensions menu, select Feed . The map module is located in this section.
- Find the Google Sitemap extension and click the Install button if it is not already installed.
- After installation, click Edit .
- Set the status to Enabled .
- Specify the required settings and click the Save button.
Access to the site map
Once you enable the sitemap, you will be able to access it via the following URL:
http://yourdomain.com/index.php?route=extension/feed/google_sitemap
where yourdomain.com is your domain.
Setting up CNC (Human-Readable URLs)
If you have friendly URLs enabled, the URL may look different, for example:
http://yourdomain.com/sitemap.xml
This may require adding a rule to your .htaccess file to redirect.
Adding a sitemap to search engines
Once you have generated your sitemap, you can add this URL to Google Search Console or other search engines to help them index your site.
Example .htaccess configuration for a sitemap
# Enable mod_rewrite support RewriteEngine On # If your site is not running in the root folder, please specify the appropriate directory RewriteBase / # Redirect requests to sitemap.xml to dynamically generate a sitemap RewriteRule ^sitemap\.xml$ index.php?route=extension/feed/google_sitemap [L]
This .htaccess file fragment will direct requests to sitemap.xml to the appropriate route in OpenCart, which generates the sitemap.
5. Example sitemap.xml file
If you need to create your own sitemap.xml file, you can do it manually, although this is not recommended as dynamic sitemap generation is more flexible and up-to-date. However, as an example, a sitemap.xml file might look like this:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://yourdomain.com/</loc> <lastmod>2023-01-01</lastmod> <changefreq>monthly</changefreq> <priority>1.0</priority> </url> <url> <loc>http://yourdomain.com/category</loc> <lastmod>2023-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> <!-- Other URLs for your site here --> </urlset>



















































Comments