<?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: Regex assistance for htaccess puzzle.</title>
      <link>http://ask.metafilter.com/47430/Regex-assistance-for-htaccess-puzzle/</link>
      <description>Comments on Ask MetaFilter post Regex assistance for htaccess puzzle.</description>
	  	  <pubDate>Wed, 27 Sep 2006 17:03:51 -0800</pubDate>
      <lastBuildDate>Wed, 27 Sep 2006 17:03:51 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: Regex assistance for htaccess puzzle.</title>
  	<link>http://ask.metafilter.com/47430/Regex-assistance-for-htaccess-puzzle</link>	
  	<description>Regex assistant for redirecting affiliate links. Currently my affiliate links are structured like:&lt;br&gt;
&lt;br&gt;
http://&lt;em&gt;ecommercesystem&lt;/em&gt;.com/app/aftrack.asp?afid=123456&amp;amp;u=&lt;em&gt;mysalespage.com&lt;/em&gt;&lt;br&gt;
&lt;br&gt;
Where &apos;123456&apos; is a multiple digit affiliate ID and the u variable is where the ecommerce system sends the referred user after they are tagged by the affiliate system.&lt;br&gt;
&lt;br&gt;
I&apos;d like to make it easier for my affiliates to be able to create affiliate links in the form:&lt;br&gt;
&lt;br&gt;
http://myssite.com/aff/123456/ppp&lt;br&gt;
&lt;br&gt;
Where ppp is a multi-letter product code that tells which salespage to send to. I could have multiple lines in the htaccess for each product code &apos;aaa&apos;, &apos;cat&apos;, &apos;dog&apos;, etc. Hopefully this can be done with a polite 301 redirect.&lt;br&gt;
&lt;br&gt;
Thanks!</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.47430</guid>
  	<pubDate>Wed, 27 Sep 2006 16:16:48 -0800</pubDate>
  	<dc:creator>ao4047</dc:creator>
	
	<category>regex</category>
	
	<category>htaccess</category>
	
	<category>ecommerce</category>
	
</item>
<item>
  	<title>By: jcruden</title>
  	<link>http://ask.metafilter.com/47430/Regex-assistance-for-htaccess-puzzle#722072</link>	
  	<description>Mod rewrite will do exactly what you&apos;re looking for.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Mod_rewrite&quot;&gt;http://en.wikipedia.org/wiki/Mod_rewrite&lt;/a&gt;</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47430-722072</guid>
  	<pubDate>Wed, 27 Sep 2006 17:03:51 -0800</pubDate>
  	<dc:creator>jcruden</dc:creator>
</item>
<item>
  	<title>By: ao4047</title>
  	<link>http://ask.metafilter.com/47430/Regex-assistance-for-htaccess-puzzle#722141</link>	
  	<description>Yup - I know. I&apos;ve been hammering on Regex Coach for a few hours now and I&apos;m not having success yet. Hoping there was a RegEx wiz out there that can do this with their eyes closed.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47430-722141</guid>
  	<pubDate>Wed, 27 Sep 2006 17:59:52 -0800</pubDate>
  	<dc:creator>ao4047</dc:creator>
</item>
<item>
  	<title>By: ijoshua</title>
  	<link>http://ask.metafilter.com/47430/Regex-assistance-for-htaccess-puzzle#722190</link>	
  	<description>&lt;code&gt;RewriteRule ^aff/([0-9]+)/([a-z]+) http://ecommercesystem.com/app/aftrack.asp?afid=$1&amp;amp;u=$2 [L,R=301]&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Im not certain if this is what youre asking for&  What is the relationship between &lt;i&gt;ppp&lt;/i&gt; and &lt;i&gt;mysalespage.com&lt;/i&gt;?  Your description seems to indicate that they arent equal, but that there is some mapping.  If that is the case, youll need more rules.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47430-722190</guid>
  	<pubDate>Wed, 27 Sep 2006 18:58:11 -0800</pubDate>
  	<dc:creator>ijoshua</dc:creator>
</item>
<item>
  	<title>By: ao4047</title>
  	<link>http://ask.metafilter.com/47430/Regex-assistance-for-htaccess-puzzle#722247</link>	
  	<description>Let&apos;s say I have three products: ABC, DEF, GHI. All of these products are managed in the same ecommerce system and have the same affiliate system but have differnet salespages.&lt;br&gt;
&lt;br&gt;
RewriteRule ^aff/([0-9]+)/ABC http://ecommercesystem.com/app/aftrack.asp?afid=$1&amp;amp;u=www.abcsalespage.com&lt;br&gt;
&lt;br&gt;
RewriteRule ^aff/([0-9]+)/DEF http://ecommercesystem.com/app/aftrack.asp?afid=$1&amp;amp;u=www.defsalespage.com&lt;br&gt;
&lt;br&gt;
RewriteRule ^aff/([0-9]+)/GHI http://ecommercesystem.com/app/aftrack.asp?afid=$1&amp;amp;u=www.ghisalespage.com&lt;br&gt;
&lt;br&gt;
I&apos;ll try the example you posted. Thanks!</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47430-722247</guid>
  	<pubDate>Wed, 27 Sep 2006 20:07:47 -0800</pubDate>
  	<dc:creator>ao4047</dc:creator>
</item>
<item>
  	<title>By: ao4047</title>
  	<link>http://ask.metafilter.com/47430/Regex-assistance-for-htaccess-puzzle#722287</link>	
  	<description>The example from above works - thanks so much ijoshua (and jcruden).</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47430-722287</guid>
  	<pubDate>Wed, 27 Sep 2006 20:57:09 -0800</pubDate>
  	<dc:creator>ao4047</dc:creator>
</item>
<item>
  	<title>By: websavvy</title>
  	<link>http://ask.metafilter.com/47430/Regex-assistance-for-htaccess-puzzle#722296</link>	
  	<description>http://www.txt2re.com/ is really cool and helpful for people toying with regular expressions.  You can enter an example piece of text and it will generate code which matches whatever portions of it you&apos;d like.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47430-722296</guid>
  	<pubDate>Wed, 27 Sep 2006 21:08:12 -0800</pubDate>
  	<dc:creator>websavvy</dc:creator>
</item>

    </channel>
</rss>
