Forum Moderators: phranque
Thanks to help found here at WW this is what I've installed:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ [mysite.com...] [R=permanent,L]
Works fine, but redirects to www.mysite.com/index.htm
If I just type in mysite.com I get www.mysite.com/index.htm
If I type in www.mysite.com I get www.mysite.com/
So what am I missing? How do I get the rdirect to drop the index.htm, or can I?
[Can you tell I'm new to htaccess? And why is it that the more I learn, the less I seem to know?]
I was just searching for this same thing this morning. Try this thread:
[webmasterworld.com...]
It seemed to start at your same point and work forward.
good luck
Meanwhile, Ive come across another question.
The code I posted above has [R=permanent,L] in it.
I see other people suggesting [R=301,L]
I wonder what the difference is, or if one is better than the other?
1) Your code is fine. Exactly right, in fact.
2) [R=permanent] and [R=301] are equivalent. [R=301] is "better" only in that it takes fewer characters to type.
3) The bad news: Some other code or configuration setting on your site is causing the problem. The code you posted is not the cause. If you have no other .htaccess code or scripts that could do this, then you'll need to ask your host about this problem.
Jim
The only other thing in my htaccess is a line to generate a 404 page.
ErrorDocument 404 /page_not_found.htm
Which seems to work fine, but that doesn't mean it's right :)
"Ask...host" Yeahhhhh.... that aint as easy as it sounds. Mega-monster-cheapo-deluxe host support seems to kmow less than I do. But I can always give it a shot :)
The reason I want the index.htm dropped is to achieve conformity with my links. I suppose when I change them from relative to absolute I could make the include the index.htm.
Not my first choice, but maybe it'd work.
Thanks again.