Bug #17009
closed
default .htaccess file does not rewrite correctly
Added by Lukas Rueegg almost 18 years ago.
Updated about 6 years ago.
Description
the following line in the default .htaccess file doesn't rewrite correctly on the files 'showpic.php' and 'favicon.ico' because of the implicit '/' at the end of the line:
RewriteRule ^(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php|favicon\.ico)/ - [L]
it should be corrected by either adding a '?' after the slash to make the slash optional or by separating calls to directories and files on two different rewrite rules.
if making a GET request to /favicon.ico, the file is still redirected to index.php because it doesn't match the rewrite rule which requires a trailing slash.
(issue imported from #M5020)
This is partly fixed now: The template for the packages (dummy.tar.gz) contains a fixed _.htaccess file. What remains to be done is that misc/advanced.htaccess in TYPO3core gets fixed as well.
However, most users will never notice this because they have copied the file to their website root manually. Should we try to notify them, and if so, how?
Maybe fixing misc/advanced.htaccess and an additional little entry in NEWS.txt is be enough?
Sure, it's the least we can do. However, even though I know it, I would probably not notice that one of my sites has still the old rules file...
Anyway, don't worry too much about this. At least it will work for all new sites.
Please bear with me, it's not that hard.
Rule 1:
- Never rewrite 'static' resources. That would be silly right? If a certain request exists as an actual file on the filesystem: serve the file.
Rule 2
- Rewrite everything else.
Rule 3
- wrap the rewrite stuff with an <ifModule > to avoid 500 errors.
Ship with this .htaccess enabled by default.
-------------------------------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
- Do not rewrite static resources
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule .* - [L]
- Rewrite the rest to index.php
RewriteRule .* /index.php [L]
</IfModule>
-------------------------------------------------------------------------------------------
That one is fixed: The ending slash was fixed with #23173, IfModule mod_rewrite.c was added in #23173.
Resolved.
- Status changed from Resolved to Closed
Also available in: Atom
PDF