jump to last post 1-3 of 3 discussions (21 posts)

Use subdomain URL for anchor links to avoid redirect issue iOS/Safari

  1. Dougalbunny profile image94
    Dougalbunnyposted 3 years ago

    I wanted to add a contents to my hub with links to sections within the article.  I managed to do this using the mod_##### number but then noticed that the links don't work when browsing with Safari on Iphone or Ipad, they just take you to the top of the page.  They do work with Chrome for mobile but  I have since deleted the links as I think this would be too irritating for people browsing with Safari. Is there another way of linking that would work on all browsers?

    1. Matthew Meyer profile image75
      Matthew Meyerposted 3 years ago in reply to this

      We don't officially support anchor links, but as you witnessed they do work in some browsers.
      I did a bit of research and it appears that there may be a known issue with Safari (it doesn't support named anchors).

      I found this related discussion in Apple Support forums.
      https://discussions.apple.com/thread/3132659?tstart=0

      1. Glenn Stok profile image93
        Glenn Stokposted 3 years ago in reply to this

        Matt, I read that Apple Support Forum thread. They say to use "ID=" instead of, or in addition to, using "name=" - but they didn't clarify that that refers to the destination (not the link), which is why the thread continues with people saying they don't understand. The link, itself, simply should have the URL of the hub followed by # and then the name of he capsule (i.e. #mod_nnnnnn ).

        HubPages uses "ID=" in the HTML code on the capsule names, so that's the correct method to make it work with all browsers.

        As I said in my prior comment, it works for me.

    2. Matthew Meyer profile image75
      Matthew Meyerposted 3 years ago in reply to this

      I'm working with our engineering team on this to see if we can make it work more consistently for iOS.

      Can you share examples of Hubs and the anchor URLs you are using that are not working properly in iOS?

      That way I have some additional examples to test.

      Thanks!

      1. Glenn Stok profile image93
        Glenn Stokposted 3 years ago in reply to this

        Matt, 

        I have a hub were I use anchor links to specific capsules and I never had a problem with Safari. I just checked it now using Safari 6.1.6 and it worked fine. I wonder if it's a bug in older versions of Safari.

        I am aware that sometimes HP changes the address of capsules, which breaks those links. But that's another issue. I think that happens sometimes when hubs are edited, but I'm not sure.

        1. Matthew Meyer profile image75
          Matthew Meyerposted 3 years ago in reply to this

          In my observation the issues affecting iOS/Safari and not Safari in OS X.

          1. Glenn Stok profile image93
            Glenn Stokposted 3 years ago in reply to this

            I just tested my hub on my iPad, which has iOS/Safari.  My anchor links worked there too.

            1. Matthew Meyer profile image75
              Matthew Meyerposted 3 years ago in reply to this

              It could be the issue isn't aan anchored link issue, but related toa redirect.
              Are you using URLs in the format subdomain.hubpages.com/etc... or hubpages.com/etc ?

              It looks like the non-subdomain URLs might actually be the issue.

              1. Glenn Stok profile image93
                Glenn Stokposted 3 years ago in reply to this

                My particular hub is an Editor's Choice, so it is not in the subdomain. I specify the link as
                hubpages.com/hub/title-of-hub#anchor

                You're saying that it might be a problem with non-subdomain URLs. My hub disproves that. So it must be something else for those who experience the problem.

      2. Matthew Meyer profile image75
        Matthew Meyerposted 3 years ago in reply to this

        Please see Glen's clarification below
        http://hubpages.com/forum/post/2624055

        If you are still having trouble using the links int he manner he described, let me know on what platform (browser and version, OS version, device model number), which Hub, and what links are causing issues and I can look into it further.

        1. Dougalbunny profile image94
          Dougalbunnyposted 3 years ago in reply to this

          I have removed the anchor links in my hubs for the time being. An example of anchor links that don't work using my iphone 5 running Safari are in Relache's Don't make the 10 most common hubber mistakes' hub. I'm not sure which version of Safari I have on my phone but it is as up to date as it can be. The internal links work fine on my phone when I use Chrome but Safari just reloads the page and leaves you at the top.
          Glenn, do you have a hub example that I can look at with internal links to see if they work ok for me?

          1. Glenn Stok profile image93
            Glenn Stokposted 3 years ago in reply to this

            Dougalbunny, Yes, you can see an example of internal links with an anchor in my hub "How To Claim Your Authorship With Google" - There are three of them in the second paragraph.

            Thanks for referencing Relache's hub. I took a look at it and I found the problem.

            Relache - you can fix it.  Your links go to hubpages.com but your hub is in your subdomain. I assume you once had this hub as Editor's Choice and now it's back in your subdomain. HP creates a 301 redirect in both directions - when moved to Editor's Choice and also when moved back.

            I tested your hub in Firefox and Safari. Turns out I was right in my prior comment. Firefox follows the anchor when it is 301 redirected, but Safari just follows the 301 redirection to the top of the page because it no longer has the anchor after being redirected. 

            So if you add your subdomain to your anchored URL's, it will work under all browsers.

            1. Matthew Meyer profile image75
              Matthew Meyerposted 3 years ago in reply to this

              Thanks for sharing the information Glenn!
              I appreciate it and I bet other Hubbers do as well.

              1. Glenn Stok profile image93
                Glenn Stokposted 3 years ago in reply to this

                You're welcome Matt, glad I could help.

      3. Glenn Stok profile image93
        Glenn Stokposted 3 years ago in reply to this

        I just thought of something else that might be the reason for your problem. Are you using the correct URL before the anchor?  If it's in your subdomain then you have to use your subdomain URL. But if it's an Editor's Choice hub then you have to specify the URL without your subdomain. And no WWW either, which is a mistake I see some people making.  As long as you have the exact and correct URL it should work on all modern browsers. Mine does.

        One other point. If your hub is Editor's Choice and you are using your subdomain URL, then it will follow the 301 redirect. It's possible that some browsers will lose the anchor on a URL when following a redirect. That would explain why it seems to work with some browsers and not with others. This is another reason why you need to be sure that you are using the correct URL.

      4. Matthew Meyer profile image75
        Matthew Meyerposted 3 years ago in reply to this

        UPDATE: Please see Glenn's very helpful post below.
        http://hubpages.com/forum/post/2626939

    3. relache profile image86
      relacheposted 3 years ago

      There are other browsers where this same error occurs on the HubPages site on mobile devices.

      That doesn't really bode well for those new HubPages Pro editors who are supposedly making tables of contents for people's Hubs and the entire sway towards being mobile-oriented now, does it?

      1. Matthew Meyer profile image75
        Matthew Meyerposted 3 years ago in reply to this

        @relache I did some follow up and was able to confirm that editors are not adding tables of contents to Hubs.  Can I ask where you heard that information?

        1. relache profile image86
          relacheposted 3 years ago in reply to this

          I thought I had read something to that effect in the HubPro discussion.  Perhaps I misunderstood what someone was saying amidst my horrified reaction to many of the pilot test editing stories.

          1. Matthew Meyer profile image75
            Matthew Meyerposted 3 years ago in reply to this

            If you happen to remember where you saw it, please let me know and I will make sure to clarify any inaccurate statements.

    4. Dougalbunny profile image94
      Dougalbunnyposted 3 years ago

      Thanks for the info and discussion link.  I think for the time being I will leave the contents out of my hubs as I am a safari, mobile user and I know I would find it somewhat annoying clicking on links that don't do anything so I guess other people would too!

     
    working