Forum Moderators: phranque
http://www.example.com/example
without the .html at the end.
However, my files are html files so the above doesn't work and the users are forced to type:
http://www.example.com/example.html
in order to access that part of the site. Can I prevent this requirement of a .html extension?
On my main page (http://www.example.com), the .html extension is not required funnily enough.
Thanks.
One is to set a default document in each directory so that www.example.com/filename is entered, a directory called filename has a file called something which is set as the default.
The other thing to do is called URL Re-writing, which involves knowing Apache and how to use your htaccess file. It's a bit complicated, but doable.
Do a search on rewriting URLs and you'll find lots of information.
On my main page (http://www.example.com), the .html extension is not required funnily enough.
Which is an instructive case to think about.
The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements.