Re: [users@httpd] Which file gets served when the URL does not include a mime type extension.

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

 



>  If I have a directory "test" with two files in "file.xml" and
> "file.html" can anyone tell me which should get served if I address it
> from a browser using
> 
> "http://localhost/test/file";
> 
> i.e. without specifying the suffix.
> 
> also is this behaviour configurable?
> 
> thanks,
> 
>         Dave.

Maybe you're looking for DirectoryIndex.

<Location /test>
  DirectoryIndex file.xml file.html
</Location>

With that config, Apache will look for file.xml first, and then
file.html if the first is not found. As far as serving up file.xml
when only "file" is requested, you could do something with
mod_rewrite.

RewriteRule ^/test/file$ /test/file.xml  <- will use file.xml for
"http://localhost/test/file";

.. or something like that. Check the syntax

---------------------------------------------------------------------
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