Support

Admin Tools

#22599 Rewrite URL

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 twh.creations on Wednesday, 13 May 2015 00:54 CDT

twh.creations
 Hi

We have just stumbled across a new Sitemap generator based on Xmap, called OSMap.
When we used Xmap we had a rewrite rule that would allow you to access the sitemap by adding /sitemap.xml to the end of the url and it displaying.

I have tried to re-create this with the new sitemap link provided by OSMap but the re-write condition doesn't seem to be working. I was wondering if someone knew the answer.

This would be placed in the section "Custom .htaccess rules at the bottom of the file"

Orignially, the condition was:

RewriteCond %{REQUEST_URI} ^/sitemap.xml
RewriteRule .* /index.php?option=com_xmap&view=xml&tmpl=component&id=1

I copied the new url and came up with this

RewriteCond %{REQUEST_URI} ^/sitemap.xml
RewriteRule .* /index.php?option=com_osmap&view=xml&tmpl=component&id=1

However, when I search www.mysite.com.au/sitemap.xml all I recieve is a 404 error

Any help would be appreciated, thanks

I neither despise nor fear...

dlb
You almost had it! Look up, "xml" is not a valid file type under the "Front-end file types allowed in selected directories" in .htaccess Maker. Just add xml to the list (it is case sensitive) and you should be all set.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

twh.creations
Hi Dale
I added xml to the "Front-end file types allowed in selected directories" section but unfortunately it didn't work.

I can view the sitemap using the original url (/index.php?option=com_osmap&view=xml&tmpl=component&id=1) just can't get the re-write to happen. Not sure if that was clear in my original message.

Any other ideas?

I neither despise nor fear...

nicholas
Akeeba Staff
Manager
Sorry to butt in, but I think there's a much simpler solution: the URL Rewrite feature in Admin Tools.

Go to Components, Admin Tools, URL Redirection.

At the top of the page, next to "Enable the URL Redirection feature?" select Yes, then click on the Save Preference button next to it.

Now click on the green "+ New" button in the toolbar. You need to enter the following:
  • Existing URL: index.php?option=com_osmap&view=xml&tmpl=component&id=1
  • New URL: sitemap.xml
  • Keep URL Parameters: Override all
  • Published: Yes


Click on Save & Close.

Now visiting www.mysite.com.au/sitemap.xml will redirect you to www.mysite.com.au/index.php?option=com_osmap&view=xml&tmpl=component&id=1 just fine.

Please also remove the xml extension from the "Front-end file types allowed in selected directories" setting in .htaccess Maker. There's no need to have that there.

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!

twh.creations
Thanks for the reply Nicholas. I didn't even know that feature was there!

We tested it yesterday and it looks to be working fine so thank you for the answer.

I neither despise nor fear...

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!