WordPress.org

Ready to get started?Download WordPress

Forums

Amazon Associate Filter
Plugin rewrites wireless.amazon.com links to amazon.com (2 posts)

  1. archon810
    Member
    Posted 4 years ago #

    Amazon recently launched their Wireless store - wireless.amazon.com but links to this site, which has a more custom mobile store, get rewritten back to amazon.com by this plugin.

    Please fix this, if you get a chance.

    http://wordpress.org/extend/plugins/amazon-associate-filter/

  2. archon810
    Member
    Posted 3 years ago #

    I ended up doing a quick fix myself. In fact, I don't know why it would rewrite the subdomain in the first place. Maybe you can incorporate this into trunk if you get a chance.

    svn diff
    Index: amazon_associate_filter.php
    ===================================================================
    --- amazon_associate_filter.php (revision 185613)
    +++ amazon_associate_filter.php (working copy)
    @@ -34,8 +34,8 @@
       $affiliate_code=get_option('amazon_associate_filter_id');
    
       $content=preg_replace(
    -    '/http:\/\/[^>]*?amazon.([^\/]*)\/([^>]*?ASIN|gp\/product|exec\/obidos\/tg\/detail\/-|[^>]*?dp)\/([0-9a-zA-Z]{10})[a-zA-Z0-9#\/\*\-\?\&\%\=\,\._;]*/i',
    -    'http://www.amazon.$1/dp/$3/?tag='.$affiliate_code,
    +    '/http:\/\/([^>]*?amazon.)([^\/]*)\/([^>]*?ASIN|gp\/product|exec\/obidos\/tg\/detail\/-|[^>]*?dp)\/([0-9a-zA-Z]{10})[a-zA-Z0-9#\/\*\-\?\&\%\=\,\._;]*/i',
    +    'http://$1$2/dp/$4/?tag='.$affiliate_code,
         $content
       );
       return $content;

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic