Re: Content-Type text.html for DirectoryIndex (1.3.x)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've found a partial workaround for this.

I commented out:

    #RewriteRule ^/index.html$ / [R=301,L]

And wrote another RewriteRule:

    RewriteRule ^(.*/)$ $1index.html [L]

The same URL is displayed; load http://jonathanscorner.com/admin/ and
the URL displayed in the browser window is the URL you typed in. But
besides the scenes it pulls the index.html file and sidesteps
DirectoryIndex before DirectoryIndex can assign a Content-Type of
"text.html" (or anything else).

N.B. I modified this to:

    RewriteRule ^/psalms/$ /psalms/index.cgi [L]
    RewriteRule ^(.+/)$ $1index.html [L]

as most directories have an index.html, but
http://jonathanscorner.com/ and http://jonathanscorner.com/psalms/ use
an index.cgi. As a later modification I moved the latter rule to the
end of the RewriteRules for that host, as it was preventing rewrites
from an old directory to a new directory.

I now can load URLs either like http://jonathanscorner.com/psalms/
(index.cgi) or http://jonathanscorner.com/dream/ (index.html) and have
the same browser behavior, but when I load it I don't get the
text.html warning in my error log.

So far since restarting I haven't seen any further text.html warnings.

I'd love to be able to fix the problem properly and at its source...

On Sun, Jan 24, 2010 at 7:27 PM, Jonathan Hayward
<christos.jonathan.hayward@xxxxxxxxx> wrote:
>
> I am getting an error in my log if I visit http://jonathanscorner.com/admin/ but not http://jonathanscorner.com/admin/index.html under Apache 1.3.x. The two URL's serve up the same file; on a visit to http://jonathanscorner.com/admin/ , DirectoryIndex pulls up the same index.html (that directory has no index.cgi/index.php/etc.). The message logged is:
>
> [warn] Cannot get media type from 'text.html'
>
> Is there any way in httpd.conf or .htaccess that I can get DirectoryIndex-served files to be assigned Content-Type "text/html" and not "text.html"? I haven't had success with variants on
>
> <FilesMatch "^.*/$">
> AddType text/html
> </FilesMatch>
>
> because AddType requires a second argument, an extension, and neither "" nor * nor an omitted extension will match a directory with a trailing slash and no extension.
>
> Is there any way that DirectoryIndex-served files can be specified to be text/html?
>
> --
> → Jonathan Hayward, christos.jonathan.hayward@xxxxxxxxx
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.com/



--
→ Jonathan Hayward, christos.jonathan.hayward@xxxxxxxxx
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.com/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux