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 th开发者_运维问答at, I saw some examples but any of them works for me.
Thanks.
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.
精彩评论