Project

General

Profile

Actions

Bug #17009

closed

default .htaccess file does not rewrite correctly

Added by Lukas Rueegg about 17 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2007-02-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #23173: Code for rewrite rules for .htaccess cannot be formatted (but would have to be!)ClosedErnesto Baschny2010-07-14

Actions
Related to TYPO3 Core - Bug #23799: Add IfModule mod_rewrite.c to misc/advanced.htaccessClosedErnesto Baschny2010-10-20

Actions
Actions #2

Updated by Michael Stucki about 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?

Actions #4

Updated by Christian Kuhn about 15 years ago

Maybe fixing misc/advanced.htaccess and an additional little entry in NEWS.txt is be enough?

Actions #5

Updated by Michael Stucki about 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...

Actions #6

Updated by Michael Stucki about 15 years ago

Anyway, don't worry too much about this. At least it will work for all new sites.

Actions #7

Updated by Michiel Roos almost 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.

Actions #8

Updated by Michiel Roos almost 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

  1. Do not rewrite static resources
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -l
    RewriteRule .* - [L]
  1. Rewrite the rest to index.php
    RewriteRule .* /index.php [L]
    </IfModule>
    -------------------------------------------------------------------------------------------
Actions #9

Updated by Chris topher about 13 years ago

That one is fixed: The ending slash was fixed with #23173, IfModule mod_rewrite.c was added in #23173.

Resolved.

Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF