views:

48

answers:

1

Hi, I want to be able to redirect my visitors from http://www.example.com and http://example.com to http://example.com/blog.

How can I do that, I saw some examples but any of them works for me.

Thanks.

+2  A: 

You can either use mod_alias:

RedirectMatch 301 ^/$ http://example.com/blog

Or for more complex and conditional redirections mod_rewrite:

RewriteEngine on
RewriteRule ^$ http://example.com/blog [L,R=301]

Both do exactly the same but mod_rewrite may not always be available.

Gumbo
Thank you very much. The first way just works great!
Sheldon