开发者

Redirect my subdomain to principal domain via htaccess

I created a Wordpress blog on http://staging.mydomain.com and now that the website is ready i want all the pages to point t开发者_开发问答o http://www.mydomain.com . I configured Wordpress to do that,the problem is that Google already index http://staging.mydomain.com articles and i want the pages to redirect to http://www.mydomain.com/Name-of-the-article

I search around and found that I need to do a 301 redirection via a htaccess but I don't know what to write.

Thank you for taking the time to read my answer.


RewriteEngine On

RewriteCond %{HTTP_HOST} ^staging.mydomain.com$

RewriteRule ^(.*)$  http://mydomain.com/$1 [R=permanent,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜