{"id":5,"date":"2004-07-24T11:03:38","date_gmt":"2004-07-24T11:03:38","guid":{"rendered":"http:\/\/lachy.id.au\/log\/2004\/07\/directory-restructuring"},"modified":"2006-04-30T23:55:08","modified_gmt":"2006-04-30T23:55:08","slug":"directory-restructuring","status":"publish","type":"post","link":"https:\/\/lachy.id.au\/log\/2004\/07\/directory-restructuring","title":{"rendered":"Directory Restructuring"},"content":{"rendered":"<p>For quite a while now, I\u2019ve been thinking that the original directory structure I chose for my website didn\u2019t quite match my needs. The only problem was, I didn\u2019t want to break any links that already point to existing documents in those directories. The directories I wanted to move were <a href=\"\/xhtml\/\">\/xhtml\/<\/a>, <a href=\"\/css\/\">\/css\/<\/a>, <a href=\"\/zengarden\/\">\/zengarden\/<\/a> and <a href=\"\/script\/\">\/script\/<\/a>.  I wanted to put zengarden under <abbr title=\"Cascading Style Sheets\">CSS<\/abbr>, and group the <abbr title=\"Extensible HyperText Markup Language\">XHTML<\/abbr>, <abbr title=\"Cascading Style Sheets\">CSS<\/abbr> and Script directories under a single development directory, which I decided to call <a href=\"\/dev\/\">\/dev\/<\/a>.<\/p>\r\n\r\n<p>The solution I found was to move them as described, and use Apache\u2019s <a href=\"http:\/\/httpd.apache.org\/docs-2.0\/mod\/mod_alias.html#redirect\"><code>Redirect<\/code> directive<\/a> from <a href=\"http:\/\/httpd.apache.org\/docs-2.0\/mod\/mod_alias.html\">mod_alias<\/a>.  The rules I added to my .htaccess file took this form<\/p>\r\n\r\n<pre>\r\n<code>Redirect permanent \/<var>xxx<\/var> http:\/\/www.lachy.id.au\/dev\/<var>xxx<\/var><\/code>\r\n<\/pre>\r\n\r\n<p>Where <var>xxx<\/var> represents the <abbr title=\"Extensible HyperText Markup Language\">XHTML<\/abbr>, <abbr title=\"Cascading Style Sheets\">CSS<\/abbr>, Script and ZenGarden directories.  This directive causes Apache to respond with an HTTP <code>301 Moved Permanently<\/code> status code, and the location for the user agent to find the actual resource. The only problem is that I needed to use the full <abbr title=\"Uniform Resource Identifier\">URI<\/abbr>, rather than a relative path for the redirection, which means that the same directives won\u2019t work as I wanted for my testing server on my localhost, since any request for http:\/\/localhost\/css\/, for example, will redirect to <a href=\"http:\/\/www.lachy.id.au\/dev\/css\/\">http:\/\/www.lachy.id.au\/dev\/css\/<\/a>, rather than http:\/\/localhost\/dev\/css\/.<\/p>\r\n\r\n<p>So, the problem is solved, and I\u2019ve got a much more appropriate, and hopefully permanent directory structure. This will benefit a lot for my <a href=\"http:\/\/www.csszengarden.com\/\"><abbr title=\"Cascading Style Sheets\">CSS<\/abbr> Zen Garden<\/a> submission, <a href=\"http:\/\/www.csszengarden.com\/?cssfile=http:\/\/www.lachy.id.au\/dev\/css\/zengarden\/office2003\/office2003.css\">Office 2003<\/a>, which is listed in the <a href=\"http:\/\/www.mezzoblue.com\/zengarden\/alldesigns\/themes\/\">Themes and Look-alikes<\/a> section. It still uses the old URI, so if it broke, anyone wanting to see my design would be disappointed to see an unstyled document. There are also several other links on various other sites that I know about, and possibly others that I don\u2019t, so it was very important that existing <abbr title=\"Uniform Resource Identifiers\">URIs<\/abbr> didn\u2019t break.<\/p>\r\n<span style=\"font-weight:bold;\"><\/span>","protected":false},"excerpt":{"rendered":"For quite a while now, I\u2019ve been thinking that the original directory structure I chose for my website didn\u2019t quite match my needs. The only problem was, I didn\u2019t want to break any links that already point to existing documents in those directories. The directories I wanted to move were \/xhtml\/, \/css\/, \/zengarden\/ and \/script\/. &hellip; <a href=\"https:\/\/lachy.id.au\/log\/2004\/07\/directory-restructuring\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Directory Restructuring<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts\/5"}],"collection":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":0,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"wp:attachment":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}