{"id":8,"date":"2010-09-02T03:49:36","date_gmt":"2010-09-02T03:49:36","guid":{"rendered":"http:\/\/boulderinformationservices.wordpress.com\/?p=5"},"modified":"2010-09-02T03:49:36","modified_gmt":"2010-09-02T03:49:36","slug":"modernizing-a-web-site","status":"publish","type":"post","link":"https:\/\/boulderinformationservices.com\/blog\/modernizing-a-web-site\/","title":{"rendered":"Modernizing a Web Site"},"content":{"rendered":"<p>A client wanted me to take their existing web site and add a content-management system (CMS) and a members-only area.<\/p>\n<p>The site was made with Dreamweaver templates, which helped enforce some consistency. Unfortunately, the navigation was different on every single page. I think this was done so that pages within a section could show an expanded sub-navigation list. It also allowed every page&#8217;s corresponding navigation link to not be a link (i.e., be &#8220;selected&#8221; and not clickable.)<\/p>\n<p>I decided to throw away the Dreamweaver templates and enforce my own consistency across the site, including the navigation. I knew I could write a getNavigation() function that could work on <em>any<\/em> page, and still handle the subnav and selected states.<\/p>\n<p>The site had been made with table-based layouts, so I whipped up a quick grid using OOCSS that approximated the old site and used that for my new PHP template, along with the getNavigation function.<\/p>\n<p>I converted the first file by hand to get a feel for how the work would go, and it probably took me 30 minutes. The next two or three went a little faster, and after a dozen, I was able to convert a page in about a minute. (I considered writing a script to do it for me, but that would have taken nearly as long, and I would not have the advantage of becoming familiar with each page on the site.)<\/p>\n<p>I started keeping track of new page names in an apache .httaccess file. I wanted to redirect the old .html pages to the new .php pages with a 301 HTTP status code so that bookmarks and search rankings would not be adversely affected. Since the new pages could be called anything I wanted, I ended up just leaving the file name and changing the extension. The list began to grow, and I realized there should be a way to bulk-redirect these files. I knew Apache&#8217;s mod_rewrite could do it, but I didn&#8217;t remember whether rewriting was the same as redirecting with a 301. I found out that you can send a status code as you rewrite, so I deleted the long list and used a couple of RewriteRules instead.<\/p>\n<p>That&#8217;s my progress so far, and you can hire me to do this for your web site as well. Contact me at the <a title=\"Boulder Information Services\" href=\"http:\/\/boulderinformationservices.com\/contact_us.php\">Boulder Information Services<\/a> web site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A client wanted me to take their existing web site and add a content-management system (CMS) and a members-only area. The site was made with Dreamweaver templates, which helped enforce some consistency. Unfortunately, the navigation was different on every single &hellip; <a href=\"https:\/\/boulderinformationservices.com\/blog\/modernizing-a-web-site\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[24,27,32,37,38,39,42],"_links":{"self":[{"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/posts\/8"}],"collection":[{"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":0,"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/posts\/8\/revisions"}],"wp:attachment":[{"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/media?parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/categories?post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boulderinformationservices.com\/blog\/wp-json\/wp\/v2\/tags?post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}