sciencetext提示和技巧
Blogging tips, browsing tricks and computing hacks 博客的秘诀,浏览手法和电脑骇客

Converting a Wordpress Blog into a Static Site转换WordPress所博客成为一个静态网站

July 9th, 2007 · by David Bradley 2007年7月9日,大卫布拉德利

在WordPress标志删除 Some time ago, I built a simple little website for前一段时间,我建一个简单的小网站 UK hydroseeding company英国液压喷播公司 CDTS Ltd. Cambridge Direct Tree Seeding convert brownfield and other sites into lush landscaped areas. cdts有限公司剑桥大学直接树播种转换棕色和其他的网站成为郁郁葱葱的景观美化地方。

Initially, I suggested to the company that there would be several advantages to running their site as a blog, allowing them to add their own content on an ad hoc basis, and so keep their clients and potential clients up to date with company developments and achievements.最初,我曾建议该公司将有几个优势,运行在其网站上作为一个博客,让他们加入自己的内容,一个特设的基础上,因此,保持他们的客户和潜在客户直至目前为止,与公司的发展和成就。 As the brief evolved, however, CDTS decided that it wanted a static website, with the option to add new content as and when it was needed, rather than to run the whole site as a blog.作为简短的演变,不过, cdts决定,它希望一个静态的网站,选择添加新的内容及何时需要,而不是运行整个网站作为博客。 Trouble was I had built the site as a Wordpress blog with all the attendant plugins, posts, paraphernalia.麻烦是我建的网站作为一个WordPress所博客与所有随之而来的外挂程式,职位,用具。

So, how to convert a Wordpress blog with half a dozen posts and a couple of Pages into a static site?因此,如何转换WordPress所博客一半十几员额和一对夫妇的网页成为一个静态的网站? I am sure there are various methods, but the simplest approach was to simply save the whole site to a folder on your hard drive and open it for editing in an old-style html/我相信有很多不同的方法,但最简单的办法是,只需保存整个网站到一个文件夹中对您的硬盘驱动器和打开它的编辑在一个旧型的HTML / website editor网站编辑 . Quickest way to do that is simply to browse to the homepage, in this case the最快捷的方式这样做只是为了浏览网页,在这种情况下, hydroseeding site液压喷播网站 and choose “Save as…” from the File menu, choose a suitable location in My Documents and then open up the site in your html editor.并选择“另存为… … ”从文件菜单中,选择一个合适的地点在我的文件,然后打开了网站在您的HTML编辑器。 Multiple file search and replace comes in handy for automatically stripping various chunks of Wordpress code, fixing image locations, and not forgetting to save the CSS file to the site folder too.多个文件搜索和替换来在方便的自动剥各块WordPress的代码,固定的形象,地点,不要忘记保存的CSS文件复制到站点文件夹太多。 Rename the index file as index.html重新命名索引文件,作为为index.html

Next step is to backup the original Wordpress installation, just in case.下一步就是要备份原有的WordPress安装,以防万一。 Then, fix up the .htaccess file (basically remove the Wordpress section and make .html the default file extension rather than .php for the index file. While you’re there, you might check your canonical domain redirect to make sure you are pointing domain.com with a 301 (permanent) redirect to www.domain.com.然后,修复了。 htaccess的文件(基本上是删除的WordPress科和作出的。 html的默认文件扩展,而不是。 PHP的为索引文件的同时,您有,你可能会检查您的典型域的重定向,以确保您指向domain.com与301 (永久)重定向到www.domain.com 。

Finally, remove the installed Wordpress files (having remotely backed up) and then upload the “Saved as…” version just edited.最后,删除已安装的WordPress文件(有远程备份) ,然后上传“另存为… … ”版本刚编辑。 A quick scan with Xenu reveals any missing or faulty links.快速扫描与xenu揭示了任何遗漏或错误的链接。 So back to the html, couple of quick fixes and another upload of the errant files.所以回的HTML ,数一蹴而另一上传的错误文件。 Xenu now clean. xenu现在清洁。 New site, static-ized.新的网站,静态的链接。 Done.做完。

One thing I would like to do with the site is to use CSS to generate the graphical display so that I could slot in different photos for the four-photo gallery at the top of each page, rather than creating a unique header image for each page of the site.一件事,我想这样做与网站是使用CSS生成图形显示,使我可以在不同时段的照片为4 -照片画廊在上方的每一页,而不是创造一个独特的标题图片的每一页该幅土地。 That would allow me to chop and change images on each page much more easily without having to fire up Photoshop and do a whole lot of slicing and dicing.这将允许我向印章及改变图像在每一页上更为容易,无须消防了Photoshop和做了大量的整个切片和切割。 If any SigFig readers can advise on a simple way to do that, I’d love to hear from you.如果任何sigfig读者可以提供意见,一个简单的方法来做到这一点,我喜欢听到您的意见。

By the way, hydroseeding is the art of converting a brownfield or other barren site into a lush, ecologically rich and esthetically pleasing environment using a special selection of seeds,由的方式,液压喷播是艺术的转换棕色或其他贫瘠的网站成为一个郁郁葱葱,生态丰富和esthetically令人高兴的环境使用一支特殊的选择种子, fertilizer肥料 and water and spraying the site selectively with appropriate seed mixes.水和喷涂的网站选择适当的种子混入。 CDTS Ltd were the UK pioneers of the technique and have carried out cdts有限公司被英国的先驱技术,并已进行 hydroseeding液压喷播 (or hydraseeding) right across the England and Wales. (或hydraseeding )的权利,整个英格兰和威尔士。

10 responses so far ↓ 10的反应,到目前为止↓

  • jeremy 杰里米 // / / Jul 11, 2007 at 12:02 am 2007年7月11日在上午12时02分

    For a company website that doesn’t change much that is a good idea.一个公司的网站,这并不太大变化,这是个好主意。 Then of course it’s harder to get noticed on the web, and harder to build a community, but those are all client problems right?那么当然它的努力得到注意到,在网路上,加倍努力,建立一个社会,但这些都是客户端的问题,对不对? Gotta give em what they ask for… sigh.奥谢说,让他们在有什么要求…感叹。

  • David Bradley 大卫布拉德利 // / / Jul 11, 2007 at 7:14 am 2007年7月11日在上午07时14分

    A website can still change and evolve without it relying on blogging structure or software.一个网站仍然可以变化和演变没有它,依靠博客的结构或软件。 There is, of course, another alternative to simply making a blog-type site entirely static and that is to有,当然是另一种选择简单地作出一个博客型网站完全静态的,那就是 use Wordpress as a content management system使用的WordPress作为一个内容管理系统 with a dynamic homepage, but exclude “The Loop” if the client does not wish to have any dynamic posts/comment content.一个动态网页,但排除“河套”如果客户端不希望有任何的动态职位/评论的内容。

  • David Szpunar 朱什普纳尔 // / / Jul 21, 2007 at 4:46 pm 2007年7月21日在下午4时46分

    We’re actually converting our existing custom-PHP website at work into a “static” site with WordPress as the CMS.我们正在转换,其实我们现有的自订PHP的网站,在工作中成为一个“静态”网站与WordPress所作为的CMS 。 Means easier templating, easy to edit pages as needed without special software (Dreamweaver) and without modifying the template.手段更容易模板,易于编辑页面需要无需特殊的软件( Dreamweaver中)和在不修改模板。 Plus, we change the main page weekly, and will likely use Posts for this page, just displaying the most recent one–no one will ever know it’sa blog most likely, although we may make the feed available if people want to subscribe to the weekly news that way.另外,我们改变主网页每周,可能会使用的职位,这页中,只需展示最近期的一个没有人会知道,这是博客最有可能的,虽然我们可能会使饲料可如果人们想订阅每周新闻的方式。

    The plugins, flexibility, and my familiarity with WordPress already made it a no-brainer as the choice.该插件,灵活性和我熟悉的WordPress已经取得的,它不作为是自然而然的选择。 There’s already a plugin to do almost everything we need, and if there isn’t I can write one or customize one and still make it easy to upgrade the WordPress core with new versions without having to re-edit the customized code.还有的已经是一个插件做的几乎一切都需要我们,如果没有,我可以写一或自订一个仍然可以很容易地升级的WordPress的核心与新版本无需重新编辑定制的代码。

    Plus, security holes are found and fixed the by community, rather than custom code which we’ve had some security problems with in the past.另外,安全漏洞被发现和固定的社区,而非自定义代码,我们已经有一些安全问题,在过去的。 Just not enough eyes to cover it all!只是没有足够的眼中,涵盖了一切!

  • David Bradley 大卫布拉德利 // / / Jul 23, 2007 at 3:24 pm 2007年7月23日在下午3时24分

    Yeah, good way to go if you need to use a CMS and want all the pros of Wordpress.是啊,良好的路要走,如果你需要使用一细胞质雄性不育,并希望所有的利弊, WordPress的。 Like I said, this particular site is now entirely static, which means no worries about insecure plugins, dynamic page generation, or anything else related to WP and CMS come to that.就像我说,这是在特定网站上,现在完全是静态的,这意味着不用担心不安全的插件,动态网页的一代,或其他任何相关的可湿性粉剂和CMS来。 Simple as it is, it does it’s job for the company very well (they tell me)简单,因为它是,它的确能做到的工作,该公司很清楚(他们告诉我)

  • David Szpunar 朱什普纳尔 // / / Jul 23, 2007 at 3:30 pm 2007年7月23日下午3时30分

    I suppose it comes down to: update often or not?我认为可以归结为:更新往往或不? A static site will scale well and has less security vulnerability surface area, but if your goal is to keep the site updated with fresh information continually (especially across multiple people maintaining the site), a CMS is worth the extra effort and resources.一个静态的网站将和规模,以及减少了安全漏洞,比表面积,但如果您的目标是把网站的更新与新的资料不断(特别是横跨多个人民维护网站) ,细胞质雄性不育是值得额外的精力和资源。

    I like your post either way; I hadn’t actually thought of converting from WordPress to static before.我很喜欢您的文章无论哪种方式;我没有想过,其实从转换的WordPress静态前。 It’s not something I’ll likely ever do, but it’s good to think about what others are doing once in a while; it stimulates new ideas.这不是我将以往任何时候都可能这样做,但它的好处,认为不在乎别人怎么做,一旦在一段时间;刺激的新思路。 Thanks.谢谢。

  • David Bradley 大卫布拉德利 // / / Jul 23, 2007 at 4:08 pm 2007年7月23日在下午4时08分

    Horses for courses and all that.马匹的课程,和所有。 The guys at CDTS opted not to have the blogging option.球员在cdts选择不有博客选项。 Of course, frequently updated content and new information are the lifeblood of blogs , but are not necessarily that important to everyone who wants a website.当然,经常更新的内容和新的信息是命脉,博客,但并不一定是那么重要,大家谁想要一个网站。

  • David Szpunar 朱什普纳尔 // / / Jul 23, 2007 at 4:13 pm 2007年7月23日在下午4时13分

    Nope…and if you look like you need new information and don’t have it, you’ll look worse than if you put up static information that doesn’t say “last post three years ago” nope …如果您看起来像你需要新的信息和没有它,您看不如如果您提出的静态信息,这并不说: “去年后3年前” :-) Now, you may not get as much attention from search engines, etc. since they do like new stuff, but if you don’t want to commit the resources to stay updated, don’t make a site you have to update!现在,您可能不会取得十分重视从搜索引擎等,因为他们喜欢新东西,但如果你不想犯下的资源留在更新,不作您的网站更新! I see this mistake all the time on sites where they didn’t really know how much time it would take to keep the site updated so it reflects poorly on them.我认为这是错误的所有时间,地点,他们没有真正了解了多少时间,将采取保持网站更新,以便它反映不佳对他们的影响。

    I think we’re in full agreement.我认为我们正处在全面协议。

  • David Bradley 大卫布拉德利 // / / Jul 23, 2007 at 5:59 pm 2007年7月23日在下午5时59分

    I think we most certainly are.我认为我们最肯定。 From the SEO perspective it is worth having a site that is fresh, but if the site is #1 for its keywords on the basis of skillful setup it doesn’t really matter too much in the end.从徐的角度来看,这是值得拥有的网站是新鲜,但如果该网站是# 1供其关键词的基础上熟练的安装并没有真正的事太多,在年底。

  • Makeda makeda // / / Feb 6, 2008 at 2:59 pm 2008年2月6日在下午2时59分

    I am thinking of converting my blog into a website with my own url.我想到的转换我的博客成为一个网站,与我自己的网址。 I have my blog on blogger.我有我的博客的Blogger 。 Is it possible to do the same?是否有可能这样做?

    Makeda’s last blog post.. makeda的最后的博客帖子.. The Single Girls Guide to Valentine’s Day 单女童指南valentineâ € ™节

  • David Bradley 大卫布拉德利 // / / Feb 6, 2008 at 3:14 pm 2008年2月6日在下午3时14分

    It most certainly is - check out this post and make sure you thoroughly research redirects and other such matters here and elsewhere there is lots of advice and at least one plugin to help with the process.它当然是最-看看这个职位,并确定您彻底的研究重定向等事项在这里和其他地方有很多的意见和至少一个插件,以帮助这一进程。 But remember there are no guarantees.但请记住,有没有保证。

    http://www.sciencetext.com/blogger-custom-domain.html

    db分贝

Leave a Comment留下意见

Comments are checked for spam before appearing, no need to post it twice.评论是检查垃圾邮件之前出现,不需要后两次。

Related Posts相关文章