• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4745: Remove .htm from the list of text/plain types

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension ApacheConfigGenerator Urgent Closed TWiki performance and security folks n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


I can't believe it's just me - maybe related to my configuration?

If I edit a page using WYSIWYG (i.e. TinyMCE), then formatting and the like works quite fine, but everything which needs more input (e.g. adding a link, a table, an image, a special character) will pop up a window with HTML text in it.

This is TWiki 4.2 Beta 1, Apache/2.2.3 (Ubuntu) mod_perl/2.0.2 Perl/v5.8.8 Server, and Firefox on Ubuntu 7.0.4.

Last line of access log is

POST /twiki/bin/rest/WysiwygPlugin/tml2html
There's nothing in the error log.

The only "special" thing in the configuration I can think of is that I'm using localisation with an UTF8 locale, but I'll attach LocalSite.cfg to make sure. The other attachment is the contents of one of the popups.

-- TWiki:Main/HaraldJoerg - 28 Sep 2007

Some experiments showed it to be a server issue, and a pretty simple one: The config generator at TWiki:TWiki.ApacheConfigGenerator creates the following rule (irrelevant lines skipped):
<Directory "/var/www/twiki/pub">
    # ...
    # This line will redefine the mime type for the most common types of scripts
    # It will also deliver HTML files as if they are text files
    AddType text/plain .html .htm .shtml .php .php3 .phtml .phtm .pl .py .cgi
    # ...

This forces HTML pages from pub to be served as text/plain, and effectively kills TinyMCE. So there's a conflict between the "recommended" way to configure the server and the default editor in TWiki 4.2. I suggest to do the following:

  1. Add a AllowOverride FileInfo to the rules for pub in TWiki:TWiki.ApacheConfigGenerator
  2. Add a .htaccess file to /pub/TWiki/TinyMCEPlugin which explitly sets AddType text/html .htm .html

While I can now confirm that this would work, I've read in the docs that using .htaccess is not recommended, mainly for performance reasons. Given that the offending URLs are deeply hidden (something like /pub/TWiki/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/table/table.htm in my example), the server would have to check eight directories for the existence of the file.

Would it be sensible to remove the .htm .html restriction in the config generator and rather rely on the existing option to block direct access to viewing .htm and .html directly?

(setting to "Waiting for Feedback")

-- TWiki:Main.HaraldJoerg - 29 Sep 2007

We had this discussion a while ago. it's really nothing to do with TinyMCEPlugin, it's the config generator that's at fault. Changing headline from "Popup box when e.g. adding a link contains HTML text" and attributing to ApacheConfigGenerator.

This has bitten many people, so I'm raising it from Normal to Urgent as well.


I removed them from the example configs recently but forgot the ApacheConfigGenerator. Now it is fixed. I also forgot to remove some comment lines from the example configs. I check those in on this bug item

-- TWiki:Main.KennethLavrsen - 30 Sep 2007

Summary Remove .htm from the list of text/plain types
ReportedBy TWiki:Main.HaraldJoerg
Codebase 4.2.0
SVN Range TWiki-4.3.0, Sat, 22 Sep 2007, build 14996
AppliesTo Extension
Component ApacheConfigGenerator
Priority Urgent
CurrentState Closed
WaitingFor TWiki performance and security folks
Checkins TWikirev:15098 TWikirev:15099
TargetRelease n/a

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatcfg LocalSite.cfg r1 manage 7.8 K 2007-09-28 - 22:15 HaraldJoerg My configuration, with paths substituted by TWIKIROOT (and no password, of course)
Texttxt popup_window.txt r1 manage 3.8 K 2007-09-28 - 22:20 HaraldJoerg HTML content of a popup window
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2007-09-30 - KennethLavrsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback