1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

JavaScript vs. PHP links

Discussion in 'PHP' started by digitalpoint, Mar 4, 2004.

  1. #1
    I always see the message pop up about how to use JavaScript to "conserve" PageRank.

    First of all, I think trying to "conserve" PageRank is bad practice. That being said, you can do it much cleaner with a PHP (or pretty much any other language).

    
    <?php
    	header("Location: http://$url");
    ?>
    
    PHP:
    Simply use that script (let's call it out.php), and then have your outbound link like so:

    http://www.yourdomain.com/out.php?url=www.cnn.com

    That will end up doing a 302 redirect to the destination. But as many people know, that will still pass PageRank. So the easy solution is to add this to your robots.txt file:

    
    User-agent: *
    Disallow: /out.php
    
    Code (markup):
    Now search engines aren't allowed to follow the links to begin with.

    Again, not something I practice, but it's so easy I figured I would share...

    - Shawn
     
    digitalpoint, Mar 4, 2004 IP
  2. jarvi

    jarvi Well-Known Member

    Messages:
    127
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #2
    Whilst people wishing to conserve pagerank makes it more time consuming to check link exchanges, I do think there is one legitimate reason to use it and that is when linking via affiliate links to merchants. Many of them compete with us in the search engines, PPC (inflating the prices) and running their own 'independant' portals. Why should give them the added boost of a non-reciprocated link?

    Just a thought.
     
    jarvi, Mar 9, 2004 IP
  3. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #3
    Agreed... the only thing I use it for is just that (affiliate links).

    - Shawn
     
    digitalpoint, Mar 9, 2004 IP
  4. Foxy

    Foxy Chief Natural Foodie

    Messages:
    1,614
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Interesting

    There is an article about PR that is pushing the view that the algo has been changed that the PR is not that important but the number of links both themed and otherwise both in and out are more important.

    In other words the PR reduction [drain] of outward linking [and effect of] is more than compensated for by the weight of the algo on links.

    The author I respect as a good thinker and I must admit I tend to agree with his thinking.

    More to the point he says that there is more weight being added to internal linking and, as such site maps and sub sitemaps and footer links are king.

    Now I had been thinking about this for some time before reading his article, and, for those who don't know me I rate reciprocal linking as commercially non viable, had come to the conclusion that my original model of site linking using Hub and Satellites [self owned or controlled] needed to be expanded upon.

    My position now is of a Space Station where you have like before a central hub but this can now/should be two sites strongly linked between them, each with sub directories that have the theme of the outlying satellites which link individually to the single circle outer ring of sites [like a bicycle wheel spoke] which each link to a similar themed site or sub in that site which in turn is linked back to the original dirctory. This way you get the theming passing through the links and the whole SS holds together.

    The advantage is also that contact linking with the outside world can be controlled in a clearly defined model and you can direct the linking where you think it will assist best eg the hub.
     
    Foxy, Mar 9, 2004 IP
  5. Foxy

    Foxy Chief Natural Foodie

    Messages:
    1,614
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Here is a thread worth reading if only for the fact that someone else is putting forward the link theory

    http://www.sitepoint.com/article/1290

    I should add that the linking in my Space staion model above is ONE WAY OUT and ONE WAY BACK that is out one spoke across to the next on the rim [two directions] and back to the hubs all keeping to a steady strengthening of the theme or topic.
     
    Foxy, Mar 11, 2004 IP
  6. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I see this different. Working both sides using affiliations and running affilations Why would I hide a link to an affilate?
    I see no competion I see alternatives. I never hide the affiliate partner I use. It strengthens their brand and immage which strengthens my position and in my experience customers appreciate knowing about this early on.
    I may loose some but I gain some from brand recognition.

    Where I run affilation I encourage and actually license affiliate partners to use content from our or my clients sites.

    Affiliations are a very cheap and efficent way to do marketing. The money is in repeat visitors (each time a site/page gets bookmarked I'm happy as I see $).

    Links - nice, functional, value for visitors site I link and info. If they link back fine if not fine.
    If it's a great site I ask for content license to do an intro page.
    I always get it - a lot of times they send me a affiliation code as well without even asking them for it.

    This works for me - never needed to try to get PR just got it - reasonably high positioned - thus it's more fun to hunt for new products and let affiliates do the selling.

    Enough blurb written - now it's back to content - 100 pages by Monday.
    M
     
    expat, Mar 12, 2004 IP
  7. Owlcroft

    Owlcroft Peon

    Messages:
    645
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #7

    There is a problem there if url is itself a call containing ampersands. In other words, this will fail at the destination end--

    http://www.yourdomain.com/out.php?url=xyz.com?x=7&y=3

    --because your php script will only take the string preceding the ampersand as belonging to the variable "url".

    I am about as far as one gets from being expert in php, but this seems to work for me:

    <?php

    $url=substr($_SERVER['QUERY_STRING'],4);
    header('Location: http://'.$url);

    ?>

    The length 4 is just the length of the string url= and must be changed if you use a different name.

    In fact, I suppose that those fanatic about conserving bytes could just use this--

    <?php

    header('Location: http://'.$_SERVER['QUERY_STRING']);

    ?>

    --where the corresponding call is--

    http://www.yourdomain.com/out.php?xyz.com?x=7&y=3

    (or whatever).
     
    Owlcroft, Mar 20, 2004 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    You can do it if you url encode it before you pass it to the script... In PHP you can do it with the urlencode() function.

    - Shawn
     
    digitalpoint, Mar 20, 2004 IP
  9. Owlcroft

    Owlcroft Peon

    Messages:
    645
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Aha. Well, as I said, "I am about as far as one gets from being expert in php". I taught myself over a three-day weekend a while back, using the online manual. I am now caught in the infamous evolutionary trap: If it's good enough, why do better? So I lazily put aside finding better ways to do things so long as I can do them at all without grotesque amounts of labor. I really must break out of that mode.
     
    Owlcroft, Mar 20, 2004 IP
  10. softwareguru

    softwareguru Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Please don't mind but i don't agree with that , requirements can make us to get changed
     
    softwareguru, Jan 23, 2008 IP