<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Otto on WordPress &#187; files</title>
	<atom:link href="http://ottopress.com/tag/files/feed/" rel="self" type="application/rss+xml" />
	<link>http://ottopress.com</link>
	<description>You have to use an Ottopress to get fresh squeezed Otto.</description>
	<lastBuildDate>Thu, 26 Jan 2012 21:19:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://ottopress.com/?pushpress=hub'/>
<cloud domain='ottopress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>WordPress 3.0 Multisite Attachment Handling</title>
		<link>http://ottopress.com/2010/wordpress-3-0-multisite-attachment-handling/</link>
		<comments>http://ottopress.com/2010/wordpress-3-0-multisite-attachment-handling/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 14:21:43 +0000</pubDate>
		<dc:creator>Otto</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[multisite]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[search regex]]></category>

		<guid isPermaLink="false">http://ottopress.com/?p=198</guid>
		<description><![CDATA[One of the things that changes in WP 3.0 with multi-site is where file uploads and attachments get stored. This can be confusing to people trying to do export/imports and combine sites together. In the .htaccess file of a multisite installation, you&#8217;ll find this little bit of code: # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] [...]]]></description>
			<content:encoded><![CDATA[<fb:like href='http://ottopress.com/2010/wordpress-3-0-multisite-attachment-handling/' send='true' layout='standard' show_faces='true' width='450' height='65' action='recommend' colorscheme='light' font='lucida+grande'></fb:like><p><a href="http://ottopress.com/files/2010/04/blue-xl.png"><img class="alignright size-full wp-image-93" title="WordPress Logo" src="http://ottopress.com/files/2010/04/blue-xl.png" alt="" width="250" height="250" /></a>One of the things that changes in WP 3.0 with multi-site is where file uploads and attachments get stored. This can be confusing to people trying to do export/imports and combine sites together.</p>
<p>In the .htaccess file of a multisite installation, you&#8217;ll find this little bit of code:</p>
<p><code># uploaded files<br />
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]</code></p>
<p>The effect of this code is to redirect requests that have &#8220;files&#8221; in the name to the ms-files.php. As you may have guessed, ms-files.php is the multi-site file handler.</p>
<p>Files in multi-site mode are stored in the /wp-content/blogs.dir structure. Inside that directory, you will find subdirectories labeled with numbers (1, 2, 3, etc.).  Each number corresponds to the ID number of the individual site in the multi-site installation. Each one of these directories holds all the uploaded files for that installation. The ms-files.php file handles a bunch of caching parameters and then sends the file off to the browser upon request.</p>
<p>So the resulting URLs always look like http://example.com/files/2010/whatever.jpg and so forth. The &#8220;files&#8221; name is therefore special and reserved and cannot be used as a post slug and such.</p>
<p>When you export a site from somewhere and then import it into your new multi-site system, if you also choose to import the attachments, then you&#8217;ll have a minor problem. The attachments will be imported into this new files structure. However, the links from an older system are still referring to the old /wp-content/uploads/ directory structure that non-multi-site installs use. Therefore, you will need to go back through your posts and fix all these links and references to the attachments. I use the <a href="http://wordpress.org/extend/plugins/search-regex/">Search Regex</a> plugin for this purpose, it works well enough and has some powerful search and replace capabilities.</p>
<a href='http://twitter.com/share?url=http%3A%2F%2Fotto42.com%2Fd&count=vertical&related=otto42%2Cottodestruct&text=WordPress 3.0 Multisite Attachment Handling' class='twitter-share-button' data-text='WordPress 3.0 Multisite Attachment Handling' data-url='http://otto42.com/d' data-counturl='http://ottopress.com/2010/wordpress-3-0-multisite-attachment-handling/' data-count='vertical' data-via='ottodestruct' data-related='otto42,ottodestruct'></a><span class="fb_share"><fb:like href="http://ottopress.com/2010/wordpress-3-0-multisite-attachment-handling/" layout="box_count"></fb:like></span><div class="plusone"><g:plusone size=tall annotation=bubble align=left href="http://ottopress.com/2010/wordpress-3-0-multisite-attachment-handling/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://ottopress.com/2010/wordpress-3-0-multisite-attachment-handling/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:thumbnail url="http://ottopress.com/files/2010/04/blue-xl-200x200.png" />
		<media:content url="http://ottopress.com/files/2010/04/blue-xl.png" medium="image">
			<media:title type="html">WordPress Logo</media:title>
			<media:thumbnail url="http://ottopress.com/files/2010/04/blue-xl-200x200.png" />
		</media:content>
	</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using xcache
Object Caching 419/436 objects using xcache

Served from: ottodestruct.com @ 2012-02-04 05:58:12 -->
