Bug #23173

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

Added by André Spindler about 5 years ago. Updated over 4 years ago.

Status:Closed Start date:2010-07-14
Priority:Should have Due date:
Assigned To:Ernesto Baschny % Done:

0%

Category:- Spent time: -
Target version:-
TYPO3 Version:4.4 Is Regression:
PHP Version:5.2 Sprint Focus:
Complexity:

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)

T3InstallTool_htaccess_error_text.gif (5.6 kB) Administrator Admin, 2010-08-01 19:28

htaccess.diff Magnifier (1 kB) Administrator Admin, 2010-08-17 10:04

bug15108_v1.patch Magnifier (6.6 kB) Administrator Admin, 2010-08-17 15:49

bug15108_v2.patch Magnifier (6.7 kB) Administrator Admin, 2010-08-17 16:05

bug15108_v3.patch Magnifier (8.1 kB) Administrator Admin, 2010-08-19 11:58


Related issues

related to Core - Feature #23408: Install Tool, "All Configuration": Description of setting... Closed 2010-08-19
related to Core - Bug #17009: default .htaccess file does not rewrite correctly Resolved 2007-02-19

History

#1 Updated by Markus Klein about 5 years ago

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

#2 Updated by André Spindler about 5 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.

#3 Updated by Markus Klein about 5 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.

#4 Updated by André Spindler almost 5 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.

#5 Updated by Chris topher almost 5 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.

#6 Updated by Markus Klein almost 5 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

#7 Updated by Steffen Gebert almost 5 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

#8 Updated by Markus Klein almost 5 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?

#9 Updated by Markus Klein almost 5 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.

#10 Updated by Markus Klein almost 5 years ago

Just added v2.

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

#11 Updated by Steffen Gebert almost 5 years ago

Looks good

#12 Updated by Markus Klein almost 5 years ago

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

#13 Updated by Ernesto Baschny almost 5 years ago

commited to rev. 8683 (trunk for alpha1).

Thanks Markus!

#14 Updated by Susanne Moog over 4 years ago

  • Target version deleted (4.5.0)

Also available in: Atom PDF