Bug #23173
closedCode for rewrite rules for .htaccess cannot be formatted (but would have to be!)
0%
Description
In the installtool, the code example for .htaccess causes server crash.
Wrong:
RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
Right:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
(There are too mush dashes)
But this doesn't work anyway...
(issue imported from #M15108)
Files
Updated by Markus Klein over 14 years ago
Where exactly did you copy this line from, I can't find it?
Updated by André Spindler over 14 years ago
I have uploaded the section from a screenshot of the installtool.
The label itself is defined in t3lib/config_default.php, line 261. I just found it there as the comment/description for this value.
Updated by Markus Klein over 14 years ago
Ah now I know what you mean.
The general problem is that afaik there's no way of putting any format into these comments/descriptions.
But I admit that these "-" are a bit confusing.
Maybe you can suggest a good replacement for this and post a patch to the core mailing list.
Updated by André Spindler over 14 years ago
Hm. As the comments are processed with htmlspecialchars, there's no possibility to add any html-tags. No linebreaks or paragraphs. But perhaps a solution would be to replace the dashes with another character (as dashes are also part of the rewrite rules) and add an additional note on how to handle it.
I now found out, that this code IS working. But it has to be inserted as the first redirect rule in the .htaccess file and not at the bottom of it.
I think it makes sense to add these lines (commented out) to the default _.htaccess file in the dummy package, too.
Updated by Chris topher over 14 years ago
Hmm, I also don't have any idea how to format these lines.
But what about integrating a link (or at least the relative path) to the .htaccess file, which contains the example lines? (And remove the erroneously dashed text.)
Then people can see how it should look like, the formatting would be clear and you can easily copy it, too.
Updated by Markus Klein over 14 years ago
Hi!
Have a look at typo3_src/misc/advanced.htaccess.
This file contains all necessary stuff someone might need.
I thought maybe the current _.htaccess file in the dummy package should be replaced with the one mentioned above.
Yes, that's exactly what I meant. Replace this dashes by an adequat symbol and add an additional note.
I guess it would even be better to remove this lines at all and just put a reference to the .htaccess file shipped with Core.
regards
Updated by Steffen Gebert over 14 years ago
Yes, I think that's the way to go: Point the user to the advanced.htaccess.
Could you provide a patch for this, please?
In fact, I'm pretty sure that the dummy package contains this advanced.htaccess
Updated by Markus Klein over 14 years ago
Not at all!
I added diff between advanced.htaccess (source) and _.htaccess (dummy)
I think there should be only one place for this file.
I'd suggest to use the advanced.htaccess.
But I guess there's also a bug in this line
RewriteRule ^(typo3|t3lib|tslib|fileadmin|typo3conf|typo3temp|uploads|showpic\.php|favicon\.ico)/ - [L]
as facion.ico will never be requested as favicon.ico/.
So this version of _.htaccess is correct
RewriteRule ^(typo3/|t3lib/|tslib/|fileadmin/|typo3conf/|typo3temp/|uploads/|showpic\.php|favicon\.ico) - [L]
Also showpic.php is part of history and can be removed.
I will provide a fixed version of advanced.htaccess and config_default.php.
I vote for removing _.htaccess from the dummy package, but adding a note to INSTALL.txt where the advanced.htaccess can be found.
Where do I find the files of the dummy package in SVN?
Updated by Markus Klein over 14 years ago
Added bug15108_v1.patch
Please have a look.
I corrected this now for
$TYPO3_CONF_VARS[BE][versionNumberInFilename] and $TYPO3_CONF_VARS[FE][versionNumberInFilename].
If nobody objects I'll post this patch on core list in 24 hours.
Updated by Markus Klein over 14 years ago
Just added v2.
I accidentally deleted the description for value "false" of [BE][versionNumberInFilename].
Updated by Markus Klein over 14 years ago
v3: I added/modified some text in INSTALL.txt and NEWS.txt
Updated by Ernesto Baschny about 14 years ago
commited to rev. 8683 (trunk for alpha1).
Thanks Markus!