合并网站和博客
我的网站大约有 400 个页面。我还有一个 WordPress 博客。我想将两者整合并使其成为一个博客。
网站上现有页面的 URL 如下:
www.xyz.com/article1.htm, www.xyz.com/article2.htm, www.xyz.com/article3.htm
当我创建博客时,我希望这些链接重定向到博客上的新链接,例如:
www.xyz.com/article1.htm 应重定向到 www.newblog.wordpress.com /2009/09/09/article1.htm
www.xyz.com/article2.htm 应重定向到 www.newblog.wordpress.com/2009/09/09/article2.htm
www.xyz.com/article3.htm 应重定向到www.newblog.wordpress.com/2009/09/09/article3.htm等。
我怎样才能以最简单的方式做到这一点?
谢谢
I have around 400 pages in my website. I also have a Wordpress blog. I would like to integrate the two and make it a single blog.
The existing pages on the website have the URLs like;
www.xyz.com/article1.htm,
www.xyz.com/article2.htm,
www.xyz.com/article3.htm
When I create a blog, I want these links to be redirected to new links on the blog, like:
www.xyz.com/article1.htm should redirect to www.newblog.wordpress.com/2009/09/09/article1.htm
www.xyz.com/article2.htm should redirect to www.newblog.wordpress.com/2009/09/09/article2.htm
www.xyz.com/article3.htm should redirect to www.newblog.wordpress.com/2009/09/09/article3.htm and so on.
How can I do this in the easiest possible way?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以做的是创建一个 mod_rewrite 规则,该规则将简单地覆盖旧文章的所有情况。
如果您以统一的方式命名它们(就像您在示例中所做的那样),那么 1 个编写良好的重写规则应该能够覆盖您所有的旧内容。
Mod 重写教程
What you could do is create a mod_rewrite rule that would simply cover all the cases of your old articles.
If you name them in a uniform fashion (like you do in the example) Then 1 well written rewrite rule should be able to cover all your old stuff.
Mod Rewrite tutorial