0

I have a Joomla site which is hosted on a Linux server which has 2 files, sitemap.xml and sitemap.html. When I try to access example.com/sitemap, sitemap.xml shows up instead of sitemap.html. Can somebody explain to me how I can change this order? May be from .htaccess?

  • You could perhaps do this with .htaccess, but since this is a Joomla site and sitemap already somehow maps to sitemap.xml then maybe there is a better (ie. Joomla) way of doing this? How is sitemap being routed to sitemap.xml? Only if this is already being done in .htaccess should you seek an .htaccess solution. – MrWhite Jul 29 '16 at 8:14
  • rename your sitemap.xml – Evgeniy Jul 29 '16 at 12:16
3

If you create a page using Joomla and call it 'sitemap' it should display the content of that created page in the theme framework 'on the fly' for you. Joomla does not create a sitemap.html or sitemap.php file and put it on your server.

If you created a sitemap.html file separately on your own that will not display unless you save the file to your server and type the full name in the browser. eg. example.com/sitemap.html

You may have a plugin that is creating the sitemap.xml file automatically for you. The plugin compiles the information dynamically for the sake of submitting it to Google Search Console.

All pages are created dynamically calling on information from the MySQL database created by Joomla when you first installed it.

The permalink setting determines the way the page names display. Most choose to display the names using Post name

Common Settings

Plain             http://example.com/?p=123
Day and name      http://example.com/2016/07/30/sample-post/
Month and name    http://example.com/2016/07/sample-post/
Numeric           http://example.com/archives/123
Post name         http://example.com/sample-post/
Custom Structure  http://example.com/%postname%/

The setting you choose for permalinks will trigger Joomla to create and write code in an .htaccess file and put it on your server in the root directory such as example.com/.htaccess

The .htaccess code for Post name permalink settings looks like the following:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.