Support

Admin Tools

#25698 .htaccess XMAP sitemap.xml rewrite

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by inventgmbh on Wednesday, 03 August 2016 03:56 CDT

inventgmbh
 Hi Nicholas,

first of all congratulation vor your masterpieces of Software. We use admin Tools pro and akeeba backup pro. I run in almost any trap, but with your excellent documentation and support articles everything was solved quickly - Except one:

I use xmap in order to submit sitemap.xml to google This is exactly the same issue than Ticket #14787. I tried the same, but I always get a 404.

I added the following custom .htaccess rule at the bottom in admin Tools Config:

### XMAP Rewrite BEGIN ---
RewriteCond %{REQUEST_URI} ^/sitemap.xml
RewriteRule .* /index.php?option=com_xmap&id=1&view=xml
### XMAP Rewrite END

Allow direct access to these files: I added sitemap.XML at the bottom.

http://www2.invent-ag.de/sitemap.xml returns 404
http://www2.invent-ag.de/index.php?option=com_xmap&id=1&view=xml returns the correct sitemap.XML view.

Any Ideas ?

Best reagards, Klaus

nicholas
Akeeba Staff
Manager
Hello and thank you for your kind words.

Ticket 14787 is really old but if you really have a file called sitemap.xml on your site's root that's exactly what you need to do. However, you don't actually have such a file. Therefore you do not have the same issue and unsurprisingly my instructions do not work for you :)

The problem is that you want to add an alias which redirects requests for sitemap.xml to a different URL. Unfortunately you put this code in the wrong place. The custom code you added must go to the TOP of the file, not the bottom!

Please remember the order of instructions processed by the web server. Joomla! 3.4 and later come with a catch-all rule: if a file is not found on the server the request is forwarded to Joomla. Therefore your rule is never run because the catch-all rule has already been processed.

By putting the code at the top of the file you tell the web server to issue a redirection immediately upon seeing the sitemap.xml request. Actually, the custom code should read:
### XMAP Rewrite BEGIN ---

RewriteCond %{REQUEST_URI} ^/sitemap.xml

RewriteRule .* /index.php?option=com_xmap&id=1&view=xml [R=301,L]

### XMAP Rewrite END


The last bit I added tells Apache "issue a permanent redirection (HTTP 301), do not process any other directives for this request".

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

inventgmbh
Hi Nicholas,

sorry for the late response. This is exactliy the solution that works! Thanks a lot.
For any reason it does not work one one specific productive server, but I think we can ignore that because we moving the content to the new server and make a new design too ;-) So we can close this ticket.

Best regards, Klaus

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!