Support

Admin Tools

#38961 Is there a way to redirect .html urls to the SEF equvelent?

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
3.10.0
PHP version
7.4.33
Admin Tools version
6.1.9

Latest post by nicholas on Tuesday, 09 May 2023 05:11 CDT

[email protected]

I have a lot of SEO errors where URLS with .html extensions are creating a 404 error, because some time ago we changed our page URLs to not use .html extensions.

Is there are way to dfo a blank rule in Admin tools to redirect urls that contain .html to their equivelenet? We have a several hundred URLs to redirect, so doing them manually isn't really an option.

Β 

For instance, this page

https://www.ovations.com.au/speakers/anh-do.html

needs to redirect toΒ 

https://www.ovations.com.au/speakers/anh-do

Β 

It's worth mentioning that in teh Joomla SEO settings we have SEF URL's swuitched on, and we use URL rewriting. Adding Suffix to URL is switched off.

nicholas
Akeeba Staff
Manager

You are thinking about this the wrong way. You just need a trivial .htaccess rule:

RewriteRule ^(.*)\.html$ $1 [R=301,L]

If you are using the .htaccess Maker add this to the rules to add at the top of the file (as it needs to run before the standard SEF URL redirection).

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!

[email protected]

Amazing! Thank you.
Worked perfectly!

nicholas
Akeeba Staff
Manager

You're welcome!

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!

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!