Project

General

Profile

Actions

Bug #23173

closed

Code for rewrite rules for .htaccess cannot be formatted (but would have to be!)

Added by André Spindler almost 14 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-07-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

T3InstallTool_htaccess_error_text.gif (5.58 KB) T3InstallTool_htaccess_error_text.gif Administrator Admin, 2010-08-01 19:28
htaccess.diff (1.03 KB) htaccess.diff Administrator Admin, 2010-08-17 10:04
bug15108_v1.patch (6.64 KB) bug15108_v1.patch Administrator Admin, 2010-08-17 15:49
bug15108_v2.patch (6.7 KB) bug15108_v2.patch Administrator Admin, 2010-08-17 16:05
bug15108_v3.patch (8.15 KB) bug15108_v3.patch Administrator Admin, 2010-08-19 11:58

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #23408: Install Tool, "All Configuration": Description of settings should allow HTML markup for readabilityClosedErnesto Baschny2010-08-19

Actions
Related to TYPO3 Core - Bug #17009: default .htaccess file does not rewrite correctlyClosedMichael Stucki2007-02-19

Actions
Actions #1

Updated by Markus Klein over 13 years ago

Where exactly did you copy this line from, I can't find it?

Actions #2

Updated by André Spindler over 13 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.

Actions #3

Updated by Markus Klein over 13 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.

Actions #4

Updated by André Spindler over 13 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.

Actions #5

Updated by Chris topher over 13 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.

Actions #6

Updated by Markus Klein over 13 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

Actions #7

Updated by Steffen Gebert over 13 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

Actions #8

Updated by Markus Klein over 13 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?

Actions #9

Updated by Markus Klein over 13 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.

Actions #10

Updated by Markus Klein over 13 years ago

Just added v2.

I accidentally deleted the description for value "false" of [BE][versionNumberInFilename].

Actions #11

Updated by Steffen Gebert over 13 years ago

Looks good

Actions #12

Updated by Markus Klein over 13 years ago

v3: I added/modified some text in INSTALL.txt and NEWS.txt

Actions #13

Updated by Ernesto Baschny over 13 years ago

commited to rev. 8683 (trunk for alpha1).

Thanks Markus!

Actions #14

Updated by Susanne Moog about 13 years ago

  • Target version deleted (4.5.0)
Actions

Also available in: Atom PDF