I've got what seems to be a trivial thing to do but I can't seem to get it working right. What I want to do is transparently remap "index.html" (only) to "index.shtml" without actually visibly redirecting. After a bit of poking around, it seemed as if this .htaccess command should do the trick:
If you're curious, I want to do this because my host (DH) only runs files with an .shtml extension through the SSI parser by default. I have largely static pages, so this is good--no extra time parsing what doesn't need it. But now I'm trying to add a little SSI directive to the main index page for the entire domain. Up to now, I'd been using index.html for that, and I don't want to affect the links to such. But if I do a standard "Redirect 301" statement, when somebody hits the domain without anything after the first / it tacks on index.shtml instead of leaving it "bare". I prefer the "bare" style, and I also don't really want to be visibly redirecting to .shtml, either.
The funny thing is when I added the above to the .htaccess on a test domain, it worked absolutely perfectly. When I did it on my main domain, no go.
If there were a way to use an AddHandler directive in .htaccess to run only one specific filename through the SSI parser rather than ALL .html files, that would do the trick too, of course, but I don't see that that's an option, either.
...but while it DOES seem to do what I want it to on one domain, on another I keep getting visibly forwarded to index.shtml. Am I missing something here?RewriteEngine On
RewriteBase /
RewriteRule index.html index.shtml [L]
If you're curious, I want to do this because my host (DH) only runs files with an .shtml extension through the SSI parser by default. I have largely static pages, so this is good--no extra time parsing what doesn't need it. But now I'm trying to add a little SSI directive to the main index page for the entire domain. Up to now, I'd been using index.html for that, and I don't want to affect the links to such. But if I do a standard "Redirect 301" statement, when somebody hits the domain without anything after the first / it tacks on index.shtml instead of leaving it "bare". I prefer the "bare" style, and I also don't really want to be visibly redirecting to .shtml, either.
The funny thing is when I added the above to the .htaccess on a test domain, it worked absolutely perfectly. When I did it on my main domain, no go.
If there were a way to use an AddHandler directive in .htaccess to run only one specific filename through the SSI parser rather than ALL .html files, that would do the trick too, of course, but I don't see that that's an option, either.