如何301重定向从一个域中的所有页面一个页面上不同的域 [英] How to 301 redirect all pages from one domain to one single page on a different domain
本文介绍了如何301重定向从一个域中的所有页面一个页面上不同的域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I'm尝试做301重定向的htacess文件。我想指出的上的另一个域中的所有网页在一个域为一个页面,然后我不想手动重定向所有单页。
例如:www.olddomain.com/1.html和www.olddomain.com/2.html应该都指向www.newdomain.com。
希望有人可以帮助我。
解决方案
的RewriteCond%{HTTP_HOST} * olddomain重定向\ .COM $
重写规则^ http://www.newdomain.com/one-single-page.html [L,R = 301]
I´m trying to do a 301 redirect in a htacess file. I want to point all pages on one domain to one single page on another domain and I do not want to manually redirect all single pages.
Ex: www.olddomain.com/1.html and www.olddomain.com/2.html should both point to www.newdomain.com.
Hope anyone could help me.
解决方案
RewriteCond %{HTTP_HOST} .*olddomain\.com$
RewriteRule ^ http://www.newdomain.com/one-single-page.html [L,R=301]
这篇关于如何301重定向从一个域中的所有页面一个页面上不同的域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文