[TYPO3-core] RFC #5020: Use better rewrite rules in .htaccess

Michiel Roos [netcreators] michiel at netcreators.com
Mon Jun 21 10:29:11 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 6/21/10 8:45 AM, Ernesto Baschny [cron IT] schreef:
> The main benefit I see with the rule:
> 
> RewriteRule
> ^(typo3|t3lib|tslib|fileadmin|typo3conf|typo3temp|uploads|showpic\.php|favicon\.ico)/
> - [L]
> 
> is that it includes the whole directory structure, saying: "There is no
> frontend rendering in these directories".
> 
> I have seen plenty of extensions, modules and site implementations where
> the biggest performance hit was reference to non-existing files in
> typo3conf/... (e.g. a CSS file) which ended up trying to render an not
> existing path as a frontend page (going through realurl, TYPO3 frontend
> rendering etc), which was much worse than just a "404" from the web
> server which would have been served in no time.
> 
> So -1 on the change from my side.

Ok I agree,

But showpic.php no longer exists.

<IfModule mod_rewrite.c>
RewriteEngine On

# Prevent serving TYPO3 404 pages for missing files
RewriteRule
^(typo3(conf|temp)?|fileadmin|uploads|t3lib|clear.gif|index.php|favicon.ico)
- - [L]

# 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>

Results on amount of mod_rewrite log lines for a page with normal
content and one missing image:

Current .htaccess rules untouched: 58 lines
New .htaccess rules untouched    : 85 lines
New .htaccess rules + Ernesto fix: 51 lines

- -- 

Met vriendelijke groet / Warm regards,


Michiel Roos

Chief Technical Officer
TYPO3 Developer
Certified TYPO3 Integrator

t. 06 458 7 8 9 10
w. www.netcreators.com
_____________________________________________
Netcreators: Open Source, Open Minds, Open People
_____________________________________________

TYPO3 Developer gezocht, lees de vacature online:
http://www.netcreators.com/over-netcreators/vacatures/
_____________________________________________
Netcreators publiceert open source Producten & Diensten Catalogus op
basis van
TYPO3. Nu al in gebruik bij de gemeenten Leiden, Heemskerk en Hof van
Twente.
_____________________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwfIswACgkQLMRd8N/xuiyW7ACfdRi4H/W9vpm9M2VF/ADvymaE
MEwAoNOfxjIV2IwJdPNU8MpYFFDtM0nJ
=rA68
-----END PGP SIGNATURE-----


More information about the TYPO3-team-core mailing list