开发者

Apache says HOST can't be resolved when filetype is .doc

Directory contains about a dozen html files. Index.html contains links to all the others.

Same directory contains hundreds of Word files. HTML files contain links to the Word files.

All links are relative, i.e., no protocol, no host, no path, and no slash.

Click on a link to an HTML file, it works. Click on a link to a word doc, browser says it can't be found. To get more precise on the error, I used wget

Oversimplified version:

wget "http://Lang-Learn.us/RTR/Immigration.html"

gives me the file I asked for, but

wget "http://Lang-Learn.us/RTR/Al otro lado.doc"

tells me that Lang-Learn.us doesn't exist (400)

Same results if I use "lang-learn.us" instead. I did verify correct casing on the filenames themselves, and also tried escaping the spaces with %20 (didn't help, not that I expected it to after the host name message).

The actual session:

MBP:~ wgroleau$ wget "http://Lang-Learn.us/RTR/Immigration.html"
--2011-03-09 00:39:51--  http://lang-learn.us/RTR/Immigration.html
Resolving lang-learn.us... 208.109.14.87
Connecting to lang-learn.us|208.109.14.87开发者_如何学编程|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `Immigration.html.2'

    [ <=>
 ] 5,973       --.-K/s   in 0s

2011-03-09 00:39:51 (190 MB/s) - `Immigration.html.2' saved [5973]

MBP:~ wgroleau$ wget "http://Lang-Learn.us/RTR/Al otro lado.doc"
--2011-03-09 00:40:11--  http://lang-learn.us/RTR/Al%20otro%20lado.doc
Resolving lang-learn.us... 208.109.14.87
Connecting to lang-learn.us|208.109.14.87|:80... connected.
HTTP request sent, awaiting response... 400 No Host matches server name lang-learn.us
2011-03-09 00:40:11 ERROR 400: No Host matches server name lang-learn.us.

The error looks like an issue with redirection or domain mapping, but how could that be turned on or off by the file extension?

The hosting provider at first tried to tell me I don't know how to write HTML, but when I mentioned I've been in software for thirty years and web work for several, he put me on hold to find someone that actually knows something. Eventually they came back and said it's MY fault for not having the correct stuff in .htaccess

Setting aside the obvious retort about it being the hosting provider's job to put the correct stuff in httpd.conf, I made a couple of attempts. But 99% of my web work has been content in HTML/PHP/perl and I know nearly nothing about .htaccess

The following two attempts did NOT work:

AddType  application/msword        .doc
AddType  application/octet-stream  .doc

UPDATE: By using

<FilesMatch "\.html$"> 
   ForceType application/octet-stream
</FilesMatch>

I verified that the server does allow .htaccess, but using .doc instead of HTML still gets that idiotic "ERROR 400: No Host matches server name lang-learn.us"


Finally, after hours with more than one "tech supporter," I got them to admit that they had made a configuration error. Besides telling me to use .htaccess, they had an earlier suggestion that I ask the client to convert his hundreds of Word files into HTML pages.

Since the provider is the one that screwed up, there technically is no answer to the question of what can I do to fix it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜