Many people make a common mistake while installing the blogs on their domain,What they do is they install the blog on some folder rather than the root of the website.Hence the address of the blog becomes something like www.mydomain.com/blog without keeping any content on the root of the site (i.e. mydomain.com)
That’s not the only case,Many times by misake OR unknowingly they make their whole website on some other folder rather than the root.and It become a mess to again shift the website one tree down
BUT there is one thing which could solve this issue without moving the whole website,That’s redirecting the users from the root -> to that folder.
Redirection can be made using META tags or using .htaccess file .Use of .htaccess is recommended in redirection cases as many search engine penalizes for using a META refresh tags( as it is mostly used by keyword spammers)
So coming to the point, consider you own a domain “mydomain.com” And you want to redirect all the traffic form “mydomain.com” to “mydomain.com/blog” then use these codes on the .htaccess file on the root (mydomain.com/)
These codes can also be used if you want .. .. . to change your default web page to some other internal folder page.(although htaccess default directory can be used)
In all these examples mydomain.com/ is considered as root AND /blog/ is considered as the internal folder
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ /blog/ [R=301]
</IfModule>
OR
RewriteEngine on
RewriteRule ^([/]+)$ blog/$1 [L,R=301]
OR
RedirectMatch permanent ^/$ http://mydomain.com/blog/
Although I will recommend to use the 1st one.
Sumeet





Just what I was looking for!
thanks a lot!
A simple php redirection in the index file would also work :
@Soumik
Ofcource you can BUT few Searchengines treat them as spam pages
Read this page for more info
http://snipurl.com/28cas
Hello Sumeet, your tip worked great for a while, but suddenly it stopped working it does redirects www no no-www (wich i preffer) but the root doesn’t send you to the blog folder
do you think you can reply me by email, so I can send you my root .htaccess, maybe I did something wrong
thanks in advance
Hello esck
If it suddenly stopped working then probably a something is wrong with your server’s config OR your webhost made some changes.
Also I am using these same codes on few of my sites and they are working perfectly fine