Support

Admin Tools

#39081 index.php redirection

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
4.2.9
PHP version
8.1
Admin Tools version
7.3.3

Latest post by artax on Monday, 12 June 2023 10:34 CDT

artax

Good morning,

on htaccess maker, "Redirect index.php to the site's root" is set to YES. However, it does redirect only the home page, meaning home-page.index.php to the site's root.

It doesn't redirect, say, home/index.php/blog and so that page becomes a duplicate of home/blog.

Am I missing something or should we add something on .htaccess under here "##### Redirect index.php to / -- BEGIN" ?

Thanks,

have a good day.

nicholas
Akeeba Staff
Manager

It's only meant to redirect the main index.php.

URLs like /index.php/something and /something are not considered as duplicates by search engines since early 2010.

There is no point trying to fix something that is not broken, when the fix might break some sites.

There are cases where redirecting from index.php/something to /something would, in fact, break things. Out of the top of my head, because I've seen both today and it's barely 2pm:

  • Form POST. If a browser tries to POST to /index.php/something and you tell it to redirect to /something it will use GET, not POST, therefore it will not POST the form. This leads to all sorts of hilarity. Combine this with not setting “Use URL Rewriting” in your Global Configuration and you end in a situation where you can't even log into the frontend of your site.
  • API endpoints, including the Joomla API application itself. Most, but not all, API clients will use the redirection correctly but some will default to repeating the request using GET instead of POST, PUT, PATCH, or DELETE which causes the same kind of problems I already mentioned, just far harder to troubleshoot and address. By the way, this is the default behaviour of Guzzle HTTP, the most used PHP HTTP library to interface with APIs. Unless someone is keenly aware of the issue, the won't know to set strict to true.

As you can see, “fixing” this breaks a lot of sites which is why I deliberately chose to only redirect the homepage and make it an option which I recommend turning off on most sites (it comes from a time long before 2010, when index.php in URLs would indeed mark them as duplicates).

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!

artax

Hi Nicholas, thanks for your reply.

Well, Google Search Console is complaining about home/index.php/blog but it's rather because I didn't put the canonical tag on that page, going to do it now.

Thanks,

have a good day.

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!