我不擅长重定向,所以我要问你。
我有我的老网站和一些帖子,如www.oldsite。com/category/my awesome post,www.oldsite。com/category/my-awesome-post-2。。。
我想将每个URL重定向到一个新的域,如www.newsite。com/分类/我的精彩帖子
因此,所有URL都将动态重定向。
有可能吗。
非常感谢。
我不擅长重定向,所以我要问你。
我有我的老网站和一些帖子,如www.oldsite。com/category/my awesome post,www.oldsite。com/category/my-awesome-post-2。。。
我想将每个URL重定向到一个新的域,如www.newsite。com/分类/我的精彩帖子
因此,所有URL都将动态重定向。
有可能吗。
非常感谢。
如果你想要301/302重定向站点范围,我的建议是使用。htaccess文件,但这根本不是一个好的做法。无论如何,代码应该是这样的
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^OLDDOMAIN\\.com$ [NC]
RewriteRule ^(.*)$ http://NEWDOMAIN.com [R=301,L]
注意:将R=301更改为您想要的任何值,其中R=301表示永久重定向,R=302表示临时重定向。如果要将站点迁移到另一个域上的新wp安装,需要使用wp migrate DB插件,该插件可以在以下位置找到:https://wordpress.org/plugins/wp-migrate-db/
这个插件做了一件非常糟糕的工作,用一个新的url替换数据库中的每个url,手工操作并不是很酷的过程。。然后需要通过phpMyAdmin或其他接口将db导入到新位置,并更改页面上的所有静态链接(如果有)。
请尝试查看以下链接:
http://www.wpbeginner.com/beginners-guide/beginners-guide-to-creating-redirects-in-wordpress/
https://stackoverflow.com/questions/8819706/redirect-all-traffic-to-root-of-another-domain
https://stackoverflow.com/questions/1945568/htaccess-redirect-all-pages-to-new-domain
https://stackoverflow.com/questions/15362458/redirect-all-pages-to-new-domain
https://stackoverflow.com/questions/3255967/htaccess-redirect-all-requests-to-different-domain
http://www.orderofbusiness.net/blog/redirect-old-domain-to-new-domain-via-htaccess/
当我尝试访问wp admin时,wordpress将我链接错了,链接就像是重复的。我在哪里读到过,我应该把我的永久链接重新保存。但当我按save时,我会看到:http://example.com/wp-admin/example.com/wp-admin/options-permalink.php?settings-updated=true 在permalinks页面的底部有一段文字,上面说我应该复制粘贴一些代码到.htaccess (此代码):<IfModule mod_rewrite.