View Single Post
  #7 (permalink)  
Old 05-07-2008, 10:56 AM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: 500 server error from htaccess

I think it is the suggested method because it is often already being used to deal with www.domain.tld vs domain.tld issues, so adding two more rules is often easier to explain.

You can do both of your redirects with a more traditional approach, which I would recommend over mod_rewrite if you are not already using mod_rewrite for another purpose.

Redirect 301 /index.php http://www.domain.com/
RedirectMatch 301 /(.*)/index.php http://www.domain.com/$1/

This method avoids the extra overhead of enabling the rewrite engine. However, if you already use mod_rewrite to perform internal redirects (converting URLs to query strings in a way invisible to visitors and bots) you won't save any overhead since the engine is already activated. In that case you would just use whichever method you are more comfortable with.
__________________
The best way to learn anything, is to question everything.
Reply With Quote