Want to redirect domain to blog in subfolder until full site launches
I am in the process of launching a full website that will be ready in about 6-9 months but I have a self-hosted Wordpress blog created in the meantime to start building a userbase and SEO. So since there will eventually be more to my site than a blog, my blog is located in a subfolder in my root domain (www.website.com/blog). I would like for my root domain (www.website.com) to automatically send users to my blog (www.website.com/blog). Once the full site is ready, I then want my users to enter my domain and be sent to the regular site and not the blog.
Through my searching, it seems like I will either have to set up a 301 or 302 redirect, which I understand how to do. The question is which one to use to prevent negative SEO once the full site launches. I have a feeling I should use a 302 redirect since it is a temporary redirect, but from what I have been reading, it seems like this may hurt my SEO on the popular search engines.
Your help would be greatly appreciated and I can provide more details if needed. Thanks!开发者_JS百科
I would suggest not to use external redirect and handle this via internal redirect only. That way your URL never changes and search engines will not index wrong URL. In your .htaccess put these rules for this purpose:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/+blog [NC]
RewriteRule ^(.*)$ blog/$1 [L,NE]
RewriteRule ^(/)?$ /blog [R=302]
That should do the trick.
精彩评论