[En-Nut-Discussion] [En-Nut-Announce] MicroHTTP Library

Harald Kipp harald.kipp at egnite.de
Thu Sep 13 10:44:14 CEST 2012


Hi Ole,

On 12.09.2012 13:15, Ole Reinhardt wrote:
> I'm facing a little problem when accessing the webserver with just an IP
> address:
> 
> http://192.168.10.38
> 
> gives me a 404 error
> 
> http://192.168.10.38/index.html
> 
> is ok.

You can register redirections with

 HttpRegisterRedir("", "/index.html", 301);

May be 301 is a bit too strong.


> In the old server we had a list of default files, if no one is given:
> 
> char *default_files[] = {
>     "",
>     "/index.html",
>     "/index.htm",
>     "/default.html",
>     "/default.htm",
>     "/index.shtml",
>     "/index.xhtml",
>     "/index.asp",
>     "/default.asp",
>     NULL
> };
> 
> Is there something similar intended in the uhttp library as well?
> 
> If not I would like to add if if you don't mind. Any hint, how to do
> this best? (if you just have a API extension in mind?)

One of the goals of uHTTP was to avoid such ever growing lists, which are only partly used by applications. With HttpRegisterRedir() each application can define it's own defaults.

Regards,

Harald






More information about the En-Nut-Discussion mailing list