<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: htaccess syntax woes</title>
      <link>http://ask.metafilter.com/46757/htaccess-syntax-woes/</link>
      <description>Comments on Ask MetaFilter post htaccess syntax woes</description>
	  	  <pubDate>Mon, 18 Sep 2006 14:27:12 -0800</pubDate>
      <lastBuildDate>Mon, 18 Sep 2006 14:27:12 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: htaccess syntax woes</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes</link>	
  	<description>I need to add a few lines to my htaccess file to deal with the fact that Google Image Search never updates its database One of the most common ways people find my blog is through Google Image Search. It has taken the keywords used to tag my images, as well as the pagerank of the site, and made me a prominent hit for many search terms. The trouble is, when I moved to WordPress, I broke all the links. They have not yet grown back.&lt;br&gt;
&lt;br&gt;
Most of the hits are for archive pages for the old blog. For example, someone looking for photos of Oxford might be sent to:&lt;br&gt;
&lt;br&gt;
    http://www.sindark.com/archive/2006_01_01_sibilant_archive.html&lt;br&gt;
&lt;br&gt;
Now, that page still exists. It is at:&lt;br&gt;
&lt;br&gt;
    http://www.sindark.com/blogger/archive/2006_01_01_sibilant_archive.html&lt;br&gt;
&lt;br&gt;
Ideally, the person should be sent to the new post page in the WordPress architecture, but sending them to the new location of the Blogger archive page is better than dumping them into a 404 File Not Found screen.&lt;br&gt;
&lt;br&gt;
How can I edit my htaccess file so that anyone looking for:&lt;br&gt;
&lt;br&gt;
    Xyear_Xmonth_Xday_sibilant_archive.html&lt;br&gt;
&lt;br&gt;
will be sent to&lt;br&gt;
&lt;br&gt;
    /blogger/archive/Xyear_Xmonth_Xday_sibilant_archive.html&lt;br&gt;
&lt;br&gt;
Of course, this is a temporary fix until Google finally understands the new architecture of my site.&lt;br&gt;
&lt;br&gt;
A cleaner explanation of this is &lt;a href=&quot;http://www.sindark.com/2006/09/18/htaccess-syntax-is-tricky/&quot;&gt;on my blog&lt;/a&gt; (SELF LINK!).</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.46757</guid>
  	<pubDate>Mon, 18 Sep 2006 14:10:52 -0800</pubDate>
  	<dc:creator>sindark</dc:creator>
	
	<category>htaccess</category>
	
	<category>Apache</category>
	
	<category>blog</category>
	
	<category>Google</category>
	
</item>
<item>
  	<title>By: hatsix</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712539</link>	
  	<description>RewriteRule ^archive/([A-Za-z0-9-]+) blogger/archive/$1&lt;br&gt;
&lt;br&gt;
try that on for size...&lt;br&gt;
&lt;br&gt;
for reference, there is a wonderful &lt;a href=&quot;http://www.ilovejackdaniels.com/apache/mod_rewrite-cheat-sheet/ &quot;&gt;mod_rewrite&lt;/a&gt; cheat sheet at ILoveJackDaniels.com</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712539</guid>
  	<pubDate>Mon, 18 Sep 2006 14:27:12 -0800</pubDate>
  	<dc:creator>hatsix</dc:creator>
</item>
<item>
  	<title>By: sindark</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712550</link>	
  	<description>That doesn&apos;t seem to work. Trying to go to:&lt;br&gt;
&lt;br&gt;
http://www.sindark.com/archive/2005_12_01_sibilant_archive.html&lt;br&gt;
&lt;br&gt;
still leads to a 404 screen.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712550</guid>
  	<pubDate>Mon, 18 Sep 2006 14:42:19 -0800</pubDate>
  	<dc:creator>sindark</dc:creator>
</item>
<item>
  	<title>By: RustyBrooks</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712567</link>	
  	<description>Uh, does the RewriteRule go in htaccess or the apache conf file?</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712567</guid>
  	<pubDate>Mon, 18 Sep 2006 15:03:26 -0800</pubDate>
  	<dc:creator>RustyBrooks</dc:creator>
</item>
<item>
  	<title>By: hatsix</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712586</link>	
  	<description>in the .htaccess...&lt;br&gt;
&lt;br&gt;
seems like you have it working now! (at least, it works for me!)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712586</guid>
  	<pubDate>Mon, 18 Sep 2006 15:29:12 -0800</pubDate>
  	<dc:creator>hatsix</dc:creator>
</item>
<item>
  	<title>By: hatsix</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712591</link>	
  	<description>p.s. the reason the URLs above don&apos;t work is because of the date... you didn&apos;t post anything on Jan 01...&lt;br&gt;
&lt;br&gt;
The url you posted in the comment:&lt;br&gt;
&lt;a href=&quot;http://www.sindark.com/archive/2005_12_01_sibilant_archive.html&quot;&gt;http://www.sindark.com/archive/2005_12_01_sibilant_archive.html&lt;/a&gt; &lt;br&gt;
&lt;br&gt;
works fine for me... the other URLS don&apos;t work&lt;br&gt;
&lt;br&gt;
p.s. there should already be a rule in the htaccess for pretty URLs... you should be able to dupe this to get the rules you need.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712591</guid>
  	<pubDate>Mon, 18 Sep 2006 15:34:19 -0800</pubDate>
  	<dc:creator>hatsix</dc:creator>
</item>
<item>
  	<title>By: sindark</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712593</link>	
  	<description>hatsix,&lt;br&gt;
&lt;br&gt;
I reverted to an old version that only fixes a single photo - the one of Tallinn at night. For all others, it is broken.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712593</guid>
  	<pubDate>Mon, 18 Sep 2006 15:34:49 -0800</pubDate>
  	<dc:creator>sindark</dc:creator>
</item>
<item>
  	<title>By: hatsix</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712596</link>	
  	<description>yeah, scratch my comments about it working...</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712596</guid>
  	<pubDate>Mon, 18 Sep 2006 15:38:51 -0800</pubDate>
  	<dc:creator>hatsix</dc:creator>
</item>
<item>
  	<title>By: sindark</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712608</link>	
  	<description>For the reference of anyone looking around, the htaccess file is set now to the place it was at when I posted this question.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712608</guid>
  	<pubDate>Mon, 18 Sep 2006 15:47:28 -0800</pubDate>
  	<dc:creator>sindark</dc:creator>
</item>
<item>
  	<title>By: cheaily</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712639</link>	
  	<description>Try this in your .htaccess file&lt;br&gt;
&lt;br&gt;
RewriteEngine on&lt;br&gt;
RewriteRule ^archive/([A-Za-z0-9_.]+) blogger/archive/$1&lt;br&gt;
&lt;br&gt;
if you&apos;ve already got a line with RewriteEngine on, you don&apos;t need to have it again.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712639</guid>
  	<pubDate>Mon, 18 Sep 2006 16:14:50 -0800</pubDate>
  	<dc:creator>cheaily</dc:creator>
</item>
<item>
  	<title>By: fishfucker</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712668</link>	
  	<description>A couple of additions that couldn&apos;t hurt: &lt;br&gt;
&lt;br&gt;
RewriteEngine on&lt;br&gt;
RewriteBase /&lt;br&gt;
RewriteRule ^archive/([A-Za-z0-9]+)\.html blogger/archive/$1\.html [NC,L]&lt;br&gt;
&lt;br&gt;
(the [NC,L] should be on the same line as the rewrite rule).&lt;br&gt;
&lt;br&gt;
If it doesn&apos;t work, you&apos;ll want to look at your apache error logs to see where it is going.* &lt;br&gt;
&lt;br&gt;
Another option if you *don&apos;t* want to use mod_rewrite, is to soft-link /archives to blogger/archives and then make sure apache follows symlinks by putting &apos;Options +FollowSymlinks&apos; in the .htaccess.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;* I pulled the _. and added the .html because I wasn&apos;t sure exactly how that was supposed to escape in the [A-Za-z0-9_.]) Anybody want to elaborate how that syntax is supposed to work? &lt;small&gt;&lt;/small&gt;&lt;/small&gt;</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712668</guid>
  	<pubDate>Mon, 18 Sep 2006 16:42:34 -0800</pubDate>
  	<dc:creator>fishfucker</dc:creator>
</item>
<item>
  	<title>By: sindark</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#712699</link>	
  	<description>&amp;quot;Anybody want to elaborate how that syntax is supposed to work? &amp;quot;&lt;br&gt;
&lt;br&gt;
It sure isn&apos;t intuitive, is it?</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-712699</guid>
  	<pubDate>Mon, 18 Sep 2006 17:23:45 -0800</pubDate>
  	<dc:creator>sindark</dc:creator>
</item>
<item>
  	<title>By: rampy</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#713088</link>	
  	<description>let me know how you make out with this... &lt;br&gt;
&lt;br&gt;
Wordpress&apos;s new system of doing rewriting internally instead of writing the rules to the .htaccess file directly has been giving me fits when trying to make custom rules for old content (similiar situation to yours).</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-713088</guid>
  	<pubDate>Tue, 19 Sep 2006 07:19:56 -0800</pubDate>
  	<dc:creator>rampy</dc:creator>
</item>
<item>
  	<title>By: malevolent</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#713138</link>	
  	<description>Try using a permanent redirect rather than just rewriting. How about something like this as the first rewrite rule in .htaccess?&lt;br&gt;
&lt;br&gt;
RewriteRule ^archive/([0-9]{4}_[0-9]{2}_[0-9]{2}_[a-z0-9_-]+\.html)$ /blogger/archive/$1 [R=301,L]&lt;br&gt;
&lt;br&gt;
(I&apos;ve not checked or tested that so there may be mistakes)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-713138</guid>
  	<pubDate>Tue, 19 Sep 2006 08:33:40 -0800</pubDate>
  	<dc:creator>malevolent</dc:creator>
</item>
<item>
  	<title>By: cheaily</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#713806</link>	
  	<description>&lt;em&gt;* I pulled the _. and added the .html because I wasn&apos;t sure exactly how that was supposed to escape in the [A-Za-z0-9_.]) Anybody want to elaborate how that syntax is supposed to work? &lt;/em&gt;&lt;br&gt;
&lt;br&gt;
inside a character class block (ie, []), the full-stop loses it&apos;s status as a metacharacter, and simply matches a full-stop.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-713806</guid>
  	<pubDate>Tue, 19 Sep 2006 20:15:54 -0800</pubDate>
  	<dc:creator>cheaily</dc:creator>
</item>
<item>
  	<title>By: fishfucker</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#713819</link>	
  	<description>oh. thx.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-713819</guid>
  	<pubDate>Tue, 19 Sep 2006 20:31:05 -0800</pubDate>
  	<dc:creator>fishfucker</dc:creator>
</item>
<item>
  	<title>By: sindark</title>
  	<link>http://ask.metafilter.com/46757/htaccess-syntax-woes#718366</link>	
  	<description>malevolent,&lt;br&gt;
&lt;br&gt;
Thanks a lot. I added that to my htaccess file, and it seems to be working.&lt;br&gt;
&lt;br&gt;
I will post here again if I discover some strange and terrible error.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.46757-718366</guid>
  	<pubDate>Sun, 24 Sep 2006 13:56:57 -0800</pubDate>
  	<dc:creator>sindark</dc:creator>
</item>

    </channel>
</rss>
