{"id":25,"date":"2004-07-27T18:15:04","date_gmt":"2004-07-28T02:15:04","guid":{"rendered":""},"modified":"2019-05-08T21:58:50","modified_gmt":"2019-05-09T04:58:50","slug":"beautification-by-dirification","status":"publish","type":"post","link":"https:\/\/mikeindustries.com\/blog\/archive\/2004\/07\/beautification-by-dirification","title":{"rendered":"Beautification by Dirification?"},"content":{"rendered":"<p><em><strong>Related:<\/strong> Read the resolution to this article here: <a href=\"https:\/\/mikeindustries.com\/blog\/archive\/2004\/08\/smart-urls-and-smarter-404s\">Beautification Revisited<\/a><\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/images\/inline\/underscores.gif\" width=\"100\" height=\"105\" border=\"0\" alt=\"\" class=\"rightinline\" \/>Although the subject of clean URLs has passed through the blogosphere plenty of times over the last year or two, I don&#8217;t feel there has been a definitive answer as to a) how important they are, and b) what the best way to implement them is.  I plan on making a naming-convention change at Mike Industries this week and am soliciting user feedback as to the best way to go about it.<\/p>\n<h3>Are clean URLs even necessary?<\/h3>\n<p>Clearly the most compelling use of intelligent page naming is what is known in the industry as &#8220;vanity urls&#8221;.  If we are calling out a special Lance Armstrong section on ESPN.com via the use of a television, radio, or print campaign, it is a huge advantage to point readers to something like &#8220;espn.com\/lance&#8221;.  A nice, clean, easy-to-remember URL is the only chance we have of planting information into our audience&#8217;s heads which may stick.<\/p>\n<p>But what about the recent trend towards Googlefying URLs?  In this case, you have a URL like:<\/p>\n<p><code>https:\/\/mikeindustries.com\/ blog\/ archives\/ 2004\/ 04\/ 20\/ what_is_wrong_with_the_cottage_cheese_industry\/<\/code><\/p>\n<p>&#8230; which is neither memorable nor particularly vain.  The idea, as I understand it, is mainly to pack the URL with keywords relevant to the subject of the page, so as to coax Google into awarding a higher page rank.<\/p>\n<p>There appear to be advantages and disadvantages of naming pages in this fashion.<br \/>\n<!--more--><\/p>\n<h3>Conventional wisdom<\/h3>\n<p>Although I don&#8217;t claim to be an engineer, all the database classes I took during business school told me that database entries are to be identified by their keyfields.  A keyfield contains a unique value (usually an incrementing number) which can never be duplicated across rows.  Part of the value of a keyfield is that it acts as a persistent ID and <em>never<\/em> needs to be changed since it contains no information about the entry.  Anything about the entry can be changed and it won&#8217;t affect the ID.<\/p>\n<p>Traditionally, I have viewed CMS-generated pages the same way I have viewed entries in a database.  The URL is generated from the unique keyfield and all of the content is contained within the page itself.  This is evident in the default naming conventions of many flavors of blogging software, such as Movable Type.  A Movable Type URL (up until version 3.0) contained an incrementing number, a file extension, and nothing more.  Something like 00000038.php or 00000045.html.  This makes for a nice, always-unique incrementing URL for each entry.<\/p>\n<p>When I began first developing Mike Industries, I jumped right out of the gate with Movable Type 3.0.  To my surprise, the CMS automatically began naming pages based on their page titles (dirified).  I thought this was great, since naming URLs this way seemed to be in fashion at the time.<\/p>\n<p>No sooner did I make my first entry though, that I realized the potential downside of dirified URLs.  A few minutes after clicking &#8220;Publish&#8221;, I wanted to change my page title.  As I reconsidered my page title, I began considering what might happen down the road if the same thing were to happen after people began linking to one of my dirified URLs.  URLs are probably the only thing on the web which <em>must<\/em> remain constant.  You can change practically anything you want about a page at any point in time, but once you change its URL, you sever its ties to the world.<\/p>\n<p>Another disadvantage of using Movable Type&#8217;s new URL naming convention (or any other automatic dirification mechanism) is that often the URL will get truncated into something less than optimal.  For instance, &#8220;how_to_lose_the_fatherhood_blues.php&#8221; can easily become &#8220;how_to_lose_the_fat.php&#8221;.  Because the URL is automatically generated and truncated, these things tend to happen a lot.<\/p>\n<p>A further disadvantage of dirified URLs is that using them as a tool to butter up Google is just that.  Google has smartened up to keyword packing and all sorts of other schemes, so I&#8217;m sure they will eventually smarten up to URL packing.  Additionally, it is unclear to me how much help a dirified URL really provides to one&#8217;s search engine ranking.<\/p>\n<p>Given these annoyances, I decided to check the &#8220;Use Old-Style Archive Links&#8221; option in Movable Type and keep my URLs as incrementing numbers.<\/p>\n<h3>A vanity affair<\/h3>\n<p>So here I am, chugging along with the site, and a month into it, things are working great.  No archiving problems, a few post-publishing title changes, and a general good feeling about the naming convention I chose.  But then yesterday, I got an e-mail from <a href=\"http:\/\/www.pixelnomad.com\" target=\"_blank\" rel=\"noopener noreferrer\">Sean Madden<\/a> telling me that I could create better URLs by simply adding &#8220;dirify=1&#8221; to my archive template.  I knew this, of course, because I had hastily hashed out the situation in my head during the pre-launch stage, but the e-mail exchange which followed prompted a revisiting of the topic.<\/p>\n<p>Following are some of the reasons I&#8217;m looking at dirifying my URLs again:<\/p>\n<ol>\n<li>People seem to have a nasty habit of linking to my stories and not including any text between the anchors.  Some of this is probably because blog authors have URL autolinking turned on.  This results in me seeing links on the web to my stuff which aren&#8217;t identifiable until I mouseover or click them.<\/li>\n<li>If I am trying to type one of my URLs into the location bar of my browser, the browser will suggest past pages I&#8217;ve visited within my domain but I can&#8217;t identify any of them because they are merely numeric.<\/li>\n<li>I&#8217;m starting to just get really vain about what appears in the address bar when I&#8217;m on a page. I realize this is silly, but sometimes it seems like part of the page, and if I&#8217;m a designer, I should be able to make it look better, right?<\/li>\n<\/ol>\n<h3>While we&#8217;re on the subject&#8230;<\/h3>\n<p>This isn&#8217;t directly related to the issue at hand, but it involves URL naming schemes so I&#8217;ll mention it anyway.  Both on Mike Industries and certain major commercial sites I work on, I was thinking it would be nice to set up something like this: What if you could type in a URL like &#8212;<\/p>\n<p><code>https:\/\/mikeindustries.com\/thoughts on validation<\/code><\/p>\n<p>&#8230; and the server would look for that exact URL.  If no URL was found, you would automatically be redirected to not just a 404 page, not just a search page, but a search <em>results<\/em> page which was prepopulated with results from the terms in the address bar?  If there was only one search result, maybe you&#8217;d be even be automatically redirected to that page (kind of like an &#8220;I Feel Lucky&#8221; for lazy people).<\/p>\n<p>Anyway, perhaps this has been done before, but if it hasn&#8217;t, I wouldn&#8217;t be surprised if <a href=\"http:\/\/www.shauninman.com\" target=\"_blank\" rel=\"noopener noreferrer\">The Wolf<\/a> has something cooked up by tomorrow morning. He&#8217;s kinda good.<\/p>\n<h3>Back to the program<\/h3>\n<p>Unless anyone can tell me that I was right about my initial instincts to use incrementing numbers, I think I&#8217;m going to give dirified URLs a shot.  Especially since I can group entries into directories organized by year and month, the chances of having two identical titles in the same month is nil. I just need to stop the annoying habit of changing page titles after I publish.<\/p>\n<p>Here is what I need feedback on:<\/p>\n<ol>\n<li>I use PHP on all of my pages.  I&#8217;d like to hide the PHP extension from viewers.  The two ways I know of doing this are a) creating a directory structure where each entry has its own directory and the entry itself is stored in &#8220;index.php&#8221; inside that directory, or b) using .htaccess and a ModRewrite to serve up &#8220;whatever.php&#8221; when &#8220;whatever&#8221; (no extension) is called.  I don&#8217;t like A because it seems extraneous&#8230; I don&#8217;t want to be creating directories for every file I create.  But I don&#8217;t like B because I&#8217;m not sure exactly how to implement it in a seamless way both on my server and in Movable Type.  With B, I can get the extension hiding working, but MT still wants to create links with the extensions on them.  Also with B, I need to be able to identify when a URL without an extension is actually a directory, so the index.php file can be served up appropriately instead of serving up <em>directoryname<\/em>.php.<\/li>\n<li>I_don&#8217;t_like_underscores_and_I_never_will. They remind me of when I had to take Mac files and throw underscores in them just so my less-able Windows comrades could use them. They also aren&#8217;t visible when viewed as a hyperlink because the underline occupies the same place the underscore does.  I&#8217;d like to use hyphens instead. Are there any easy ways to do this? Hacks to MT templates maybe?<\/li>\n<li>Is there any way to limit the amount of truncation in a URL? It seems like Movable Type tends to make them quite short. Is there a maximum recommended length of a filename on the web in the first place?<\/li>\n<li>Is there any functional difference between unchecking the &#8220;Use Old-Style Links&#8221; box in MT and just adding &#8220;dirify=1&#8221; to the archive template?<\/li>\n<\/ol>\n<p>And so there you have it. I appreciate any advice anyone is willing to provide, even if it is to stick with the old school style of URL naming.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Although the subject of clean URLs has passed through the blogosphere plenty of times over the last year or two, I don&apos;t feel there has been a definitive answer as to a) how important they are, and b) what the best way to implement them is. I plan on making a naming-convention change at Mike Industries this week and am soliciting user feedback as to the best way to go about it. Are clean URLs&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,282],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-code","category-original"],"_links":{"self":[{"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":0,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"wp:attachment":[{"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}