Project

General

Profile

Actions

Feature #99041

closed

Introduce documentation for the Typo3 root .htaccess file

Added by Kevin Stosik about 2 years ago. Updated 3 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Documentation
Target version:
-
Start date:
2022-11-10
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
no-brainer
Sprint Focus:

Description

I think that the .htaccess file located in the webroot directory of Typo3 is in dire need of an official documentation. (/typo3/public/.htaccess) Not only from a general perspective, but also when looking at a few specific issues/questions:

[1] If I check the “Directory Status” function (located at “Backend => Admin Tools => Environment”), then I get the following warning for the .htaccess file:

File /public/.htaccess content differs

File content is not identical to default content. This file may have been changed manually. The Install Tool will not overwrite the current version!

I think that the implications here are hard to understand without further explanations. Does Typo3 automatically update the .htaccess file when performing updates? And if it’s supposed to do that, does the warning from above mean that the process is no longer happening? Not even when performing major upgrades?

Also what if I exclusively put my changes after the “# Add your own rules here.” line? Will this trigger the above mentoined warning or not?

[2] Personally I did not actually modify the files content at all. When checking my .htaccess for differences to the vanilla content, it’s just some very minor stuff, i.e. a new file extension for a few FilesMatch declarations. Seems like a discrepancy in updates can cause the root htaccess to be detected as manually modified?

[3] If I understood this correctly, you can safely reset your .htaccess file to vanilla content by just copy & pasting the contents of typo3/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess? I think that this would be a valuable information for the official documentation.

Regards, Nefiji

Actions #1

Updated by Garvin Hicking 3 days ago

  • Status changed from New to Closed

I'm sorry this took a long time. I've just created https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/5056 to add this to the official documentation.

I think that the .htaccess file located in the webroot directory of Typo3 is in dire need of an official documentation. (/typo3/public/.htaccess) Not only from a general perspective, but also when looking at a few specific issues/questions:

Yes, thank you for this pointer, you are completely right.

Does Typo3 automatically update the .htaccess file when performing updates?

No. It only initializes the file on first install.

And if it’s supposed to do that, does the warning from above mean that the process is no longer happening?

No, it's only a pointer that there are differences that you need to resolve.

Not even when performing major upgrades?

Especially then; for minor version or patchlevel updates, no changes in the .htaccess file usually occur.

Also what if I exclusively put my changes after the “# Add your own rules here.” line? Will this trigger the above mentoined warning or not?

The file contents are not individually combed through; the "add your own rules" is only a pointer without functionality.

[2] Personally I did not actually modify the files content at all. When checking my .htaccess for differences to the vanilla content, it’s just some very minor stuff, i.e. a new file extension for a few FilesMatch declarations. Seems like a discrepancy in updates can cause the root htaccess to be detected as manually modified?

Exactly, yes. In that case you need to synchronize the file with the one delivered by TYPO3.

(Note: Usually the changes are really minor and you probably can keep using the previous .htaccess file in past versions. Breaking changes inside the file are usually accompanied by a TYPO3 changelog upgrade notice)

[3] If I understood this correctly, you can safely reset your .htaccess file to vanilla content by just copy & pasting the contents of typo3/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess? I think that this would be a valuable information for the official documentation.

Exactly, yes!

Regards,
Garvin

Actions

Also available in: Atom PDF