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

Jump to Last Post 1-3 of 3 discussions (21 posts)
  1. Dougalbunny profile image93
    Dougalbunnyposted 4 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 image72
      Matthew Meyerposted 4 years agoin 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 image98
        Glenn Stokposted 4 years agoin 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 image72
      Matthew Meyerposted 4 years agoin 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 image98
        Glenn Stokposted 4 years agoin 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 image72
          Matthew Meyerposted 4 years agoin reply to this

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

          1. Glenn Stok profile image98
            Glenn Stokposted 4 years agoin 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 image72
              Matthew Meyerposted 4 years agoin 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 image98
                Glenn Stokposted 4 years agoin 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 image72
        Matthew Meyerposted 4 years agoin 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 image93
          Dougalbunnyposted 4 years agoin 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 image98
            Glenn Stokposted 4 years agoin 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 image72
              Matthew Meyerposted 4 years agoin reply to this

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

              1. Glenn Stok profile image98
                Glenn Stokposted 4 years agoin reply to this

                You're welcome Matt, glad I could help.

      3. Glenn Stok profile image98
        Glenn Stokposted 4 years agoin 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 image72
        Matthew Meyerposted 4 years agoin reply to this

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

    3. relache profile image86
      relacheposted 4 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 image72
        Matthew Meyerposted 4 years agoin 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 4 years agoin 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 image72
            Matthew Meyerposted 4 years agoin 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 image93
      Dougalbunnyposted 4 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

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://hubpages.com/privacy-policy#gdpr

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)