Xmap sitemap as sitemap.xml
- Details
- Created on Sunday, 27 November 2011 01:30
Xmap generates the sitemap dynamically every time the sitemap is visited so it can always provide a really up to date list of links. That's the reason why there is no such sitemap.xml file. But there is a workaround for this using your .htaccess file.
Add the following lines to your .htaccess file:
RewriteCond %{REQUEST_URI} ^/sitemap.xml
RewriteRule .* /index.php?option=com_xmap&id=1&view=xml
After that, you can visit your XML sitemap using a URL like this:
http://www.example.com/sitemap.xml
Multilingual sites
If you have a multilingual site you can create as many aliases as you want. For example:
# English sitemap
RewriteCond %{REQUEST_URI} ^/sitemap-en.xml
RewriteRule .* /index.php?option=com_xmap&id=1&view=xml&lang=en
# Spanish sitemap
RewriteCond %{REQUEST_URI} ^/sitemap-es.xml
RewriteRule .* /index.php?option=com_xmap&id=1&view=xml&lang=es
If you are using SEF urls and yout site redirects the user to a specific prefix in the url, you will need to add those in your rules too, like this:
# English sitemap
RewriteCond %{REQUEST_URI} ^/en/sitemap.xml
RewriteRule .* /index.php?option=com_xmap&id=1&view=xml&lang=en
# Spanish sitemap
RewriteCond %{REQUEST_URI} ^/es/sitemap.xml
RewriteRule .* /index.php?option=com_xmap&id=1&view=xml&lang=es
Sitemap index
Another option is to create a sitemap index in your site's root folder. Just create a file called sitemap.xml in your site with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://www.example.com/index.php?option=com_xmap&view=xml&id=1&lang=en</loc>
</sitemap>
<sitemap>
<loc>http://www.example.com/index.php?option=com_xmap&view=xml&id=1&lang=es</loc>
</sitemap> </sitemapindex>
You can add as many "sitemap" sections as you want (but not more than 50,000). Just remember to update the urls with correct sitemap id and language codes, or remove the &lang=xx if not needed.
Links
- SEO Links
- Submit Website
- General Web
- Hotwire Directory
- Mozilla Ranks
- Link Fanatic
- General Web Directory
- Human Edited Directory
- PUOICM News
- ACLS Certification
- ppi claims advice company
- ppi claims
- Payday Loans
- daily deals
- bad credit loans
- mobile ad networks
- eliquid
- Ultra Directory
- Positive Finance
- Payday Loans Online
- Pataweb
- Post Articles
- Online Shopping
- Your safe way to better health
- fine jewelry
- Western Sky
Gladstone Brookes are experts in PPI Claims