Bug #17009
closeddefault .htaccess file does not rewrite correctly
0%
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)
Updated by Michael Stucki over 15 years ago
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?
Updated by Michael Stucki over 15 years ago
The link above does not work anymore. Here is it again: http://typofree.org/article/archive/2008/june/title/rethinking-the-realurl-mod-rewrite-rules/
Updated by Christian Kuhn over 15 years ago
Maybe fixing misc/advanced.htaccess and an additional little entry in NEWS.txt is be enough?
Updated by Michael Stucki over 15 years ago
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...
Updated by Michael Stucki over 15 years ago
Anyway, don't worry too much about this. At least it will work for all new sites.
Updated by Michiel Roos over 15 years ago
Here is another idea:
http://typofree.org/article/archive/2008/june/title/rethinking-the-mod-rewrite-rules-yes-again/
I have been using this on all my sites for a while now, with success.
Updated by Michiel Roos over 14 years ago
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>
-------------------------------------------------------------------------------------------