1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Wordpress] Need help with making an SEO plugin which will help backlinks

Discussion in 'Programming' started by Apsconsus, Nov 2, 2016.

Tags:
  1. Apsconsus

    Apsconsus Registered Member

    Joined:
    Apr 22, 2013
    Messages:
    89
    Likes Received:
    41
    Gender:
    Male
    Location:
    Australia
    Hi guys, apologies if the title doesn't explain anything, hard to describe with limited room.

    Basically I want to design a wordpress plugin which will redirect site visitors depending on where they come from.

    Right now I'm doing affiliate marketing (just started) and I was reading some guides on getting legit backlinks as well as just sharing your site around to places like facebook or youtube.

    The idea would be that, if a site visitor comes to my main page from google, then no redirect happens. Say however if they come from a Youtube link then it will instantly redirect them from my site to the affiliate site. Sure I could just link them to the affiliate site straight away, but then I won't actually be sharing my site around.

    To extend on this I'd want to make a plugin that allows people to input a variety of options to change this so that they can target traffic based on whatever website it comes from.

    Now I have already done some looking into this, I've found the code that would do the basics, it looks like this:

    if (strpos("youtube . com, $_SERVER['HTTP_REFERER']) !== false) {
    Header("Location: affiliate site . com");
    }

    I'd love some help with this, or just general advice. I'd be aiming to make it a free plugin and I think that it could help some people out and at least, within affiliate marketing, improve conversion rates.
     
  2. judaculla

    judaculla Jr. VIP Jr. VIP

    Joined:
    Oct 11, 2014
    Messages:
    325
    Likes Received:
    119
    Location:
    USA
    I assume you're wanting this for a more convenient means of editing your .htaccess file rather than editing it directly? If so, there is a wordpress plugin that offers that ability, as well as certain other abilities below:

    https://wordpress.org/plugins/wp-htaccess-control/

    It has a panel in which custom code can be added to the .htaccess file.

    To help you with some terminology that may make your search a bit more productive on gxxgle/stack exchange—I believe what you are describing would be considered a 'referrer-based redirect'. For searching on here, try looking at some 'domain masking' threads.

    A WARNING: Serving content that shows gxxgle one thing and the public another is against ToS and will get your site de-indexed. Such practices are also against the ToS of nearly every affiliate program that I'm aware of as well. I'm not trying to say 'tisk tisk, don't do that' —just a cautionary tale for long-term plans. Personally, I wouldn't ever use this on a site that I had anything other than short term plans for due to the inherent risk. That being said, the below code illustrates am effective means of doing this.


    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} .*referrer1.com.*$ [OR]
    RewriteCond %{HTTP_REFERER} .*referrer2.com.*$ [OR]
    RewriteCond %{HTTP_REFERER} .*referrer3.com.*$ [OR]
    RewriteCond %{HTTP_REFERER} .*referrer4.com.*$
    RewriteRule ^(.*)$ http://www.yourdomain.com/your-affiliate-offer/
    This can be done via php or other scripts as well, but if you're planning on gaming the big G, I would suggest doing it server-side via .htaccess since that would be completely invisible to web-crawlers. Hopefully, the above code is fairly self-explanatory but the gist is that you would want to replace any of the 'referrer1.com' names with those you want to refer to your affiliate page, and replace the 'http://www.yourdomain.com/your-affiliate-offer/' with the url of the page you want your visitors to see. I would suggest redirecting your targeted traffic rather than search engine traffic, as you would have better control and reduce the risk of gxxgle penalizing you.

    To be extra careful, I would add an intermediary link between your posts on social sites and etc, if they are not already nofollow, to extend the amount of time before gxxgle notices your sketchy tactics.

    In short, I don't think that would necessitate the need for a new plugin, rather just a copy/past into the .htaccess or front end usage of many already-existing .htaccess wordpress plugins.

    EDIT: I've been thinking about this for a minute, and I think it might actually be beneficial to have a stand-alone wordpress plugin to keep a more visual record of certain redirects, in sort of a table-type layout. A referrer domain -> target domain type chart would be very friendly indeed.
     
    Last edited: Nov 2, 2016
  3. Apsconsus

    Apsconsus Registered Member

    Joined:
    Apr 22, 2013
    Messages:
    89
    Likes Received:
    41
    Gender:
    Male
    Location:
    Australia
    Wow, thank you very much for this incredibly detailed post, I appreciate it. My intention, though I see how it is, was not actually to be dodgy and I wasn't aware it was against Googles TOS haha. That is unfortunate, I was quite excited to make a plugin that might help people (and myself included) but I don't think the risk is worth the reward, and whether the method would improve or deimprove conversion rates would have to be tested anyway.

    Again, thanks very much for your post, incredibly helpful.
     
    • Thanks Thanks x 1
  4. judaculla

    judaculla Jr. VIP Jr. VIP

    Joined:
    Oct 11, 2014
    Messages:
    325
    Likes Received:
    119
    Location:
    USA
    I stumbled on this today, and recalled this thread so I thought I'd share:

    https://codecanyon.net/item/wordpress-ultimate-redirect-plugin/11423006?s_rank=5

    You can see it in action by going to the following url, with the following credentials:

    Plugin Demo Admin Login: http://wur.wpengine.com/wp-admin
    Plugin Demo Admin User: wurp
    Plugin Demo Admin Password: wurp

    Looks like exactly what you would need, and for convenience I will be trying it out on a few sites myself.
     
  5. Apsconsus

    Apsconsus Registered Member

    Joined:
    Apr 22, 2013
    Messages:
    89
    Likes Received:
    41
    Gender:
    Male
    Location:
    Australia
    Hey that's really rad, thanks!
     
  6. docksonpaul

    docksonpaul Newbie

    Joined:
    Jul 13, 2016
    Messages:
    18
    Likes Received:
    0
    Gender:
    Male
    With Wordpress, the power of creating blogs and websites have shifted from the hands of the developers to the hands of the layman users. Learn how to create your own website with really cool features and plugins without even breaking a sweat.