SIG的無花果首頁SIG的無花果新聞SIG的無花果通過電子郵件SIG的無花果最熱門的職位
重要人物
Helping you, by helping myself with blogging, browsing, and tech tips 幫助您,幫助自己與博客,瀏覽和高新技術的秘訣

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/website editor.我相信有很多不同的方法,但最簡單的辦法是,只需保存整個網站到一個文件夾中對您的硬盤驅動器和打開它的編輯在一個舊型的HTML /網站編輯器。 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相關文章