lucy24 - 12:12 am on May 10, 2013 (gmt 0)
its not working.
Uh-oh, the dreaded "it's not working". What, if anything, happens when you try the rule?
RewriteRule ^(.*)\.html$ /$1/ [R]
Urk. Lots of problems there.
99 times out of 100, you want
RewriteRule ^([^.]+)\.html http://www.example.com/$1 [R=301,L]
But let's not go there.
For starters: [R] refaults to 302, a temporary redirect. (Same applies to redirects done via mod_alias, "Redirect" by that name.) If you've permanently changed the page name, you need R=301. This won't affect individual users accessing the file, but apparently makes a big difference in some search engines. It also affects responses from the w3c link checker. Don't know about Xenu.
The second problem is that you don't say what happens after
Does the content in fact live at
www.example.com/filename/index.html (or .php or whatever you normally use)? If not, you now need a second rule to rewrite-- not redirect-- the new URL to the physical location of the content.
:: break here for change in target of "you" ::
Simply let Apache handle it for you via content negotiation.
Can you elucidate? Usually when you think of mod_mime and/or mod_negotiation activity you think of jiggery-pokery involving extensions. But here-- assuming no / slash --there is no extension.
:: shuffling papers ::
Are we here [httpd.apache.org]?
to use this feature, you must have a handler set in the configuration that defines a file suffix as type-map; this is best done with
AddHandler type-map .var
in the server configuration file.
It kinda looks as if this directive has to go in the config file --unlike vanilla AddHandler, which can be used in htaccess.
Besides, the details are giving me a headache. Maybe you meant MultiViews, two paragraphs further along. This is less headachy and can definitely be set in htaccess-- but seems like it would significantly slow down the server. That is, more than a RewriteRule, which gives you an immediate one-on-one match without having to look up anything.