Redirect root directory to a subdirectory using .htaccess

Every so often I need to redirect from the root directory http://www.someserver.com to http://www.someserver.com/blah. The first thing I try is always something like:

# This does not work
RedirectMatch permanent / /blah

This ends up not working with Firefox reporting “the page isn’t redirecting properly”. I guess the server gets confused and redirects indefinitely so you must do this instead:

# Redirect from / to /blah
RedirectMatch permanent ^/$ http://www.someserver.com/blah

*cheers*

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Bloglines
  • Google Bookmarks
  • Technorati
  • TwitThis
Tags: , ,