<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Transmogrify, LLC &#187; OS X</title>
	<atom:link href="http://www.xmog.com/tag/os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xmog.com</link>
	<description>Product design, development, and management.  For start-ups and those who want to innovate like a start-up.</description>
	<lastBuildDate>Fri, 27 Jan 2012 20:35:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress Permalinks 404 when Running in OS X</title>
		<link>http://www.xmog.com/blog/wordpress-permalinks-404-when-running-in-os-x/</link>
		<comments>http://www.xmog.com/blog/wordpress-permalinks-404-when-running-in-os-x/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 14:45:11 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[404 Errors]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://beta.xmog.com/?p=237</guid>
		<description><![CDATA[I&#8217;m a designer here at Transmogrify (read: not a developer) and therefore close to none of what I&#8217;m about to write makes sense to me. I have, however, just solved a problem that&#8217;s been giving me trouble for a few &#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a designer here at Transmogrify (read: not a developer) and therefore close to none of what I&#8217;m about to write makes sense to me. I have, however, just solved a problem that&#8217;s been giving me trouble for a few hours now, and wanted to share it.</p>
<p style="text-align: left;">I installed WordPress on my MacBook Pro so that I could do a build-out of a site without needing to have hosting set up yet.  Luckily, (Snow) Leopard has Apache and PHP support preinstalled, and the WordPress setup went off without a hitch (which was pretty impressive).</p>
<p>PHP has to be put into this folder by default for it to run on your machine: /Library/WebServer/Documents/</p>
<p>I&#8217;m sure there&#8217;s some way to change that, but it&#8217;s over my head.  You can put things into subfolders in that folder though, and my install of WordPress is running from /Library/WebServer/Documents/wordpress/ (this is important to note for later).  To view the site, I just need to go to http://localhost/wordpress/ in a browser.</p>
<p>I cleared my theme and started building the design from scratch when I remembered that I hadn&#8217;t yet set up &#8220;pretty&#8221; permalinks.  The site is going to be page driven, with no posts, so I wanted to use this approach for links:</p>
<p><img class="aligncenter size-full wp-image-121" title="permalinks" src="/wp-content/uploads/old-blog/permalinks.png" alt="permalinks" width="350" height="27" /></p>
<p>Which would make links that (eventually) look like this:  www.website.com/contact.</p>
<p>After a little searching, I found some pointers from others with similar problems and followed their instructions.  What I did was as follows:</p>
<p>1.  Created an .htaccess file and dropped it into the main WordPress folder.  I made that file in TextEdit, and saved it to /Library/WebServer/Documents/wordpress/.  In order to <em>see</em> that file though, I needed to show hidden files in the Finder.  To do that, I opened the Terminal and ran this:</p>
<blockquote><p>defaults write com.apple.Finder AppleShowAllFiles TRUE</p></blockquote>
<p>and then restarted the Finder in Terminal:</p>
<blockquote><p>KillAll Finder</p></blockquote>
<p>(Note: To hide hidden files again, just run this again but change TRUE to FALSE.)</p>
<p>2.  I set permissions on the .htaccess so that it&#8217;s writable by WordPress.  The easiest way to do this is to get info (command + i) on the newly created and unhidden .htaccess file in Finder, and change all of the settings under Sharing &amp; Permissions to &#8220;Read &amp; Write.&#8221;  There&#8217;s also a nice tool for changing file permissions in a more FTP client-like way, called <a href="http://www.macchampion.com/arbysoft/BatchMod/Download.html">BatChmod</a>.  The most &#8220;natural&#8221; way is to do this via the Terminal, but I&#8217;m more of a GUI type of person.  Here&#8217;s what the Get Info screen looks like:</p>
<p><img class="aligncenter size-full wp-image-120" title="getInfo" src="/wp-content/uploads/old-blog/getInfo.png" alt="getInfo" width="265" height="516" /></p>
<p>After all of that, I thought I was good.  I went to the Permalinks settings in the WordPress Admin and set up my custom URLs.  Unfortunately, any time I changed the Permalink settings from the default setting to anything else, all of my links would change but the pages would 404.  This is where the real fun started.</p>
<p><img class="aligncenter size-full wp-image-119" title="404" src="/wp-content/uploads/old-blog/404.png" alt="404" width="350" height="261" /></p>
<p>More searching ensued, and I stumbled onto the idea that httpd.conf (an Apache configuration file) needed to be edited to allow your .htaccess to rewrite URLs.  I found this information on WordPress forum threads and blog posts like <a href="http://wordpress.org/support/topic/286833">this</a>, <a href="http://perishablepress.com/press/2006/06/14/the-htaccess-rules-for-all-wordpress-permalinks/">this</a>, and <a href="http://mu.wordpress.org/forums/topic/14778">this</a>. Though some of these suggestions may help you solve your problems, I was still faced with a dreaded 404 error on every page.</p>
<p>Those posts all pointed me to /private/etc/apache2/httpd.conf, but what I found is that the real file that needed to be fixed was here:  /private/etc/apache2/users/myusername.conf.  Here&#8217;s what I needed to do:</p>
<p>1. Opened /private/etc/apache2/myusername.conf in a text editor.</p>
<p>It looked like this:</p>
<p><img class="aligncenter size-full wp-image-115" title="Before" src="/wp-content/uploads/old-blog/Screen-shot-2010-02-03-at-10.51.26-PM.png" alt="Before" width="336" height="110" /></p>
<p>3. Copied that chunk of code and pasted it again below it.  So it looks like this:</p>
<p><img class="aligncenter size-full wp-image-116" title="Second" src="/wp-content/uploads/old-blog/secondShot.png" alt="Second" width="339" height="227" /></p>
<p>If you don&#8217;t have it already, you will also need to add &#8220;FollowSymlinks&#8221; to the Options for each entry.  (Thanks <a href="http://www.jozzhart.com/">Jozz</a>!)</p>
<p>4. Changed the Directory and the AllowOverride settings on the second entry so that all together it looked like this:</p>
<p><img class="aligncenter size-full wp-image-117" title="Finished" src="/wp-content/uploads/old-blog/Screen-shot-2010-02-03-at-10.55.08-PM.png" alt="Finished" width="339" /></p>
<p>Remember when I said the location of your WordPress install was important?  This is the directory you need to enter here.  The problem wasn&#8217;t that the .htaccess wasn&#8217;t creating the right links, it was that Apache wasn&#8217;t being pointed to that directory to find the .htaccess file.  This was the key to getting it all working.</p>
<p>5. Restarted Apache.  The easiest way to do that is by going into the Sharing preference pane and turning &#8220;Web Sharing&#8221; off and turning it back on again.</p>
<p>And finally, I had nice URLs!</p>
<p><img class="aligncenter size-full wp-image-118" title="Localhost with Nice URL" src="/wp-content/uploads/old-blog/Screen-shot-2010-02-03-at-10.57.27-PM.png" alt="Localhost with Nice URL" width="366" height="31" /></p>
<p>It&#8217;s probably a good idea to hide all of those hidden files again at this point.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xmog.com/blog/wordpress-permalinks-404-when-running-in-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

