Results 1 to 13 of 13

 

Thread: Masking Affiliate Links using .htacess...

  1. #1
    Super User

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Half way to the moon
    Posts
    167
    Thanks
    14
    Thanked 35 Times in 32 Posts


    Hi all,

    I have read many posts on hiding/masking affiliate links, but cannot seem to get this to work using .htaccess.
    For example, trying to get the affiliate link:
    www. mysite.co.uk/link.php?m=1 to display as:
    www. mysite.co.uk/go/1 etc.

    I have used:

    RewriteEngine On
    RewriteRule ^go/([^/]+)/([^/]+) link.php?m=$1 [NC]

    and
    RewriteRule ^go/([a-zA-Z0-9]+)\.html$ link.php?m=$1

    But neither seem to work.

    Any advice appreciated.

    Many Thanks.

  2. #2
    I'm not a celebrity...

    Status
    Offline
    Join Date
    Aug 2009
    Location
    The Jungle
    Posts
    622
    Thanks
    26
    Thanked 48 Times in 46 Posts
    Quote Originally Posted by tom991 View Post
    Hi all,

    I have read many posts on hiding/masking affiliate links, but cannot seem to get this to work using .htaccess. For example, trying to get the affiliate link: [url=http://www.mysite.co.uk/link.php?m=1]

    Any advice appreciated.
    Two points of advice:
    1) Google doesn't care whether your links are affiliate or not. It's considered good practice to tag paid links no follow but for most network links it makes no odds (Google knows what those links are)
    2) Masking external links is against Google's terms of service

    Why on Earth are you making life so difficult?

  3. #3
    Super User

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Half way to the moon
    Posts
    167
    Thanks
    14
    Thanked 35 Times in 32 Posts
    Quote Originally Posted by thebusiness View Post
    Two points of advice:
    1) Google doesn't care whether your links are affiliate or not. It's considered good practice to tag paid links no follow but for most network links it makes no odds (Google knows what those links are)
    2) Masking external links is against Google's terms of service

    Why on Earth are you making life so difficult?
    Thanks for your advice.
    1) I already know this. The masking is to make the links look aesthetically better.
    2) So is G going to ban the many sites that already do this?

    Constructive advice please.

  4. #4
    I'm not a celebrity...

    Status
    Offline
    Join Date
    Aug 2009
    Location
    The Jungle
    Posts
    622
    Thanks
    26
    Thanked 48 Times in 46 Posts
    Quote Originally Posted by tom991 View Post
    Thanks for your advice.
    1) I already know this. The masking is to make the links look aesthetically better.
    2) So is G going to ban the many sites that already do this?

    Constructive advice please.
    1)I accept that links can look aesthetically better but who cares really?
    2)I think when people do this from a database then Google know what's going on and don't discriminate one way or the other. Personally I do not see the point of risking a change of opinion, but that's my choice.

    Either way, I think doing this at server level is going a bit far - just my opinion?

  5. #5
    Aspirin's Avatar
    Major Headache

    Status
    Offline
    Join Date
    May 2006
    Location
    Holland
    Posts
    473
    Thanks
    0
    Thanked 14 Times in 12 Posts
    Just add this line of code for each link

    Code:
    redirect 301 /go/1 http://www.merchantsite.co.uk/link.php?m=1

    Quote Originally Posted by tom991 View Post
    Hi all,

    I have read many posts on hiding/masking affiliate links, but cannot seem to get this to work using .htaccess.
    For example, trying to get the affiliate link:
    www. mysite.co.uk/link.php?m=1 to display as:
    www. mysite.co.uk/go/1 etc.

    I have used:

    RewriteEngine On
    RewriteRule ^go/([^/]+)/([^/]+) link.php?m=$1 [NC]

    and
    RewriteRule ^go/([a-zA-Z0-9]+)\.html$ link.php?m=$1

    But neither seem to work.

    Any advice appreciated.

    Many Thanks.

  6. The Following User Says Thank You to Aspirin For This Useful Post:

    tom991 (29-08-09)

  7. #6
    Registered User

    Status
    Offline
    Join Date
    Nov 2007
    Posts
    126
    Thanks
    21
    Thanked 8 Times in 8 Posts
    I find this link useful, in fact I had to refer to it again this morning
    http://www.yourhtmlsource.com/sitema...rewriting.html

  8. The Following User Says Thank You to Richard101 For This Useful Post:

    tom991 (29-08-09)

  9. #7
    Super User

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Half way to the moon
    Posts
    167
    Thanks
    14
    Thanked 35 Times in 32 Posts
    Thanks Aspirin,

    (1) Sorry, maybe I wasn''t clear; re-direct is done with php jump script; so I don't believe a 301 redirect is needed; just need to display a 'cleaner' link.
    (2) Correct me if I'm wrong, but I believe RewriteRule has a 'catch all', so a line of code for each aff link may not be needed?
    For example, for the following aff. links, I'd like:

    • www. mysite.co.uk/link.php?m=1 to display as: www. mysite.co.uk/go/1
    • www. mysite.co.uk/link.php?m=2 to display as: www. mysite.co.uk/go/2
    • www. mysite.co.uk/link.php?m=101 to display as: www. mysite.co.uk/go/101
    • ... etc.

  10. #8
    Registered User

    Status
    Offline
    Join Date
    Jan 2008
    Location
    Yorkshire
    Posts
    536
    Thanks
    22
    Thanked 37 Times in 31 Posts
    have you tried?

    Code:
    RewriteRule ^go/([^/]+) go.php?m=$1
    also don't forget to add some checking to the variable passed to your go.php script

  11. The Following User Says Thank You to Andrew Starr For This Useful Post:

    tom991 (30-08-09)

  12. #9
    Super User

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Half way to the moon
    Posts
    167
    Thanks
    14
    Thanked 35 Times in 32 Posts
    Thanks Andrew,

    Quote Originally Posted by Andrew Starr View Post
    have you tried?
    Code:
    RewriteRule ^go/([^/]+) go.php?m=$1
    I have tried this, still doesn't work.

    I thought it may have been the options at the top of the .htaccess, as I read that 'FollowSymLinks' needs to be enabled to use 'RewriteRule'; but these seem Ok, as the options are as follows:
    Options +FollowSymLinks +ExecCGI -Indexes

    Seems strange as other RewriteRule's in the .htaccess seem to be working, i.e. non-www to the www version of URL.

    Quote Originally Posted by Andrew Starr View Post
    also don't forget to add some checking to the variable passed to your go.php script
    Checking is done in the go.php, and the actual affiliate links work fine.

  13. #10
    Registered User

    Status
    Offline
    Join Date
    Jan 2008
    Location
    Yorkshire
    Posts
    536
    Thanks
    22
    Thanked 37 Times in 31 Posts
    have you got any other rewriterules in the same .htaccess which are working?

  14. #11
    Super User

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Half way to the moon
    Posts
    167
    Thanks
    14
    Thanked 35 Times in 32 Posts
    Yes, this one:
    Code:
    # Redirect non-www to the www version #
    RewriteCond %{HTTP_HOST} ^mysite.co.uk [NC]
    RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [L,R=301]
    But I believe this is a redirect (301), i.e. if user types domain into browser, they'll be redirected, whereas I just need to mask the links on the page (if this is possible).

  15. #12
    Registered User

    Status
    Offline
    Join Date
    Jan 2008
    Location
    Yorkshire
    Posts
    536
    Thanks
    22
    Thanked 37 Times in 31 Posts
    this is what works on my server

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^mysite\.co.uk [NC,OR]
    RewriteRule (.*) http://www.mysite.co.uk/$1 [R=301,L]
    
    RewriteRule ^go/([^/]+) go.php?m=$1
    don't know whether you will need the 'Options +FollowSymLinks' line or not as I don't fully understand it but I believe it has something to do with how your server is set up

  16. The Following User Says Thank You to Andrew Starr For This Useful Post:

    tom991 (30-08-09)

  17. #13
    Super User

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Half way to the moon
    Posts
    167
    Thanks
    14
    Thanked 35 Times in 32 Posts
    Thanks Andrew. :tup

    Most likely this could be a server issue, so I will contact my host (as its still not working).



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. masking aff links in the status bar
    By TheBoyMitchell in forum Programming
    Replies: 0
    Last Post: 12-06-09, 02:17 PM
  2. Masking / Cloaking Affiliate Links
    By DLINKLA in forum Getting Started in Affiliate Marketing
    Replies: 21
    Last Post: 06-03-09, 10:16 AM
  3. Wordpress and Masking Links
    By JillyT in forum Affiliate Marketing Lounge
    Replies: 16
    Last Post: 20-02-09, 06:38 PM
  4. Masking Affiliate Links
    By munchkin in forum Programming
    Replies: 7
    Last Post: 03-12-06, 04:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2