Results 1 to 7 of 7

Thread: [2005] Convert Relative Hyperlink href into full link href

  1. #1

    Thread Starter
    Hyperactive Member Coool's Avatar
    Join Date
    Feb 2006
    Location
    System.Coool
    Posts
    333

    Unhappy [2005] Convert Relative Hyperlink href into full link href

    Hi all,

    I want to convert all the link href attribute value into full Path like..

    I have link <a href="Default.aspx"></a> that call webpage http://www.xyz.com/folder/Default.aspx

    I want to convert them in
    <a href="http://www.xyz.com/folder/Default.aspx"></a>

    I want this bec'z seach enginee rank page highly if it display full link.
    I know this is crazy. but this is requirement and i have to follow.

    If u know how to do this then plz tell .. Any new suggestion are also most welcome.

    Right now i am thinking to use regular expression to get the href attribute of each link in Page_Render method.


    Plz help me..
    I am using .NET 2010 with Windows 7

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [2005] Convert Relative Hyperlink href into full link href

    I want this bec'z seach enginee rank page highly if it display full link.
    I don't believe that for a second, because I've never seen it anywhere before. Using an absolute path makes absolutely no difference.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Convert Relative Hyperlink href into full link href

    That's the most ridiculous thing I've ever heard. Ok, it isn't actually but it is pretty ridiculous.


    But since your benevolent (and wise) clients have made this a requirement, a better idea is to use the HTML <BASE> element. You can specify the 'base' url for all the hyperlinks, I think. Isn't that good enough?

  4. #4

    Thread Starter
    Hyperactive Member Coool's Avatar
    Join Date
    Feb 2006
    Location
    System.Coool
    Posts
    333

    Re: [2005] Convert Relative Hyperlink href into full link href

    Thanks mendhak, I think base will work .. I will suggest to my PL.
    Last edited by Coool; Mar 25th, 2007 at 11:34 PM.
    I am using .NET 2010 with Windows 7

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Convert Relative Hyperlink href into full link href

    Good luck. We all know how PLs love to think outside the box and not follow orders from above mechanically. (sarcasm intended)

  6. #6

    Thread Starter
    Hyperactive Member Coool's Avatar
    Join Date
    Feb 2006
    Location
    System.Coool
    Posts
    333

    Re: [2005] Convert Relative Hyperlink href into full link href

    Yep, I understood earlier.. So, I decided to implement

    Actually,

    There are 2 solution i found.
    1) Go with Third Party Component like "ISAPI Rewrite"

    or

    2.1 http://www.primaryobjects.com/CMS/Article63.aspx

    2.2 http://msdn2.microsoft.com/en-us/library/ms972974.aspx

    but the thing is that I don't know REgEx or not having that much knowledge of Config.

    So, I just told him 'Sorry, I CAN NOT DO IT'. after all Im trainee not getting a single pany after a 11 hour of works/day
    I am using .NET 2010 with Windows 7

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Convert Relative Hyperlink href into full link href

    2.2 is the most ideal solution. Most flexible.

    Learning RegEx is not difficult. Or 'config' (web.config?) whatever you're referring to. Being a trainee can be difficult and frustrating, often, but it's like climbing up a hill. You see the hill from far away and are excited about it. Up close, you realize you're scrambling through bushes and getting cut up by thorns. Halfway up you realize your goal is in sight. And when you reach the top, you can relax and enjoy the view.

    In other words, you've got to struggle if you want to learn.

Posting Permissions

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



Click Here to Expand Forum to Full Width