undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • SEO Q&A

      Insights & discussions from an SEO community of 500,000+.

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

Browse the forum for helpful insights and fresh discussions about all things SEO.

  1. Home
  2. SEO Tactics
  3. Intermediate & Advanced SEO
  4. How do you 301 redirect URLs with a hashbang (#!) format? We just lost a ton of pagerank because we thought javascript redirect was the only way! But other sites have been able to do this – examples and details inside

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

How do you 301 redirect URLs with a hashbang (#!) format? We just lost a ton of pagerank because we thought javascript redirect was the only way! But other sites have been able to do this – examples and details inside

Intermediate & Advanced SEO
5
9
9.8k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • DA2013
    DA2013 Subscriber last edited by Aug 27, 2014, 11:53 AM

    Hi Moz,

    Here's more info on our problem, and thanks for reading!

    • We’re trying to Create 301 redirects for 44 pages on site.com.
    • We’re having trouble 301 redirecting these pages, possibly because they are AJAX and have hashbangs in the URLs.
    • These are locations pages. The old locations URLs are in the following format: www.site.com/locations/#!new-york and the new URLs that we want to redirect to are in this format: www.site.com/locations/new-york
    • We have not been able to create these redirects using Yoast WordPress SEO plugin v.1.5.3.2.
    • The CMS is WordPress version 3.9.1
    • The reason we want to 301 redirect these pages is because we have created new pages to replace them, and we want to pass pagerank from the old pages to the new. A 301 redirect is the ideal way to pass pagerank.
    • Examples of pages that are able to 301 redirect hashbang URLs include http://www.sherrilltree.com/Saddles#!Saddles and https://twitter.com/#!RobOusbey.
    1 Reply Last reply Reply Quote 0
    • JamesTDG
      JamesTDG last edited by Mar 26, 2015, 1:29 PM Mar 26, 2015, 1:29 PM

      The solution I came up with was:

      1. Create a list of all the source URLs you have, and all the destination URLs you want
      2. Create all the destination URL pages
      3. Work out what the Ugly versions of all hashbang (pretty) URLs should be and record them (ref: https://developers.google.com/webmasters/ajax-crawling/docs/specification)
      4. Implement 301 Redirects for the Ugly URLs
      5. Deploy a Sitemap with Pretty URLs
      6. Submit Your Sitemap to Google Webmaster Tools
      7. Wait for Google to re-index all your pages
      8. Check that the new URL(s) show up in Google search results too
      9. Clean up – Remove the pretty URLs from the sitemap

      Job done!

      I created a detailed page on this with examples on my blog at www.thedriversgarage.com/web-technology/redirecting-hashbang-urls-wix-urls/

      Disclaimer - Make your own enquiries and do your own tests.  I'm a pragmatist, I really don't care if this complies to standards.  It worked for me and that's all I cared about.  Google, etc. may process this stuff differently in the future. Do your own tests.

      1 Reply Last reply Reply Quote 0
      • topic:timeago_earlier,7 months
      • spencerhjustice
        spencerhjustice @DA2013 last edited by Aug 27, 2014, 1:54 PM Aug 27, 2014, 1:54 PM

        I would like to point out that twitter is using javascript redirects not serverside redirects. If you disable javascript and try that url it will load the homepage/ your twitter feed and the url will stay the same.

        The second url doesn't seem to be properly redirecting as at least for me it just 301 redirects back to itself.

        1 Reply Last reply Reply Quote 1
        • spencerhjustice
          spencerhjustice @Andy.Drinkwater last edited by Aug 27, 2014, 1:44 PM Aug 27, 2014, 1:44 PM

          That's not true. Google is able to crawl and index properly setup ajax based pages like the one in question. Bing on the otherhand is not able to do so or at least not last time I checked.

          1 Reply Last reply Reply Quote 0
          • Andy.Drinkwater
            Andy.Drinkwater @DA2013 last edited by Aug 27, 2014, 12:47 PM Aug 27, 2014, 12:45 PM

            That will teach me to skim read 😄

            Perhaps trying a different 301 plugin will help? Alternatively, you can pretty much redirect anything from within .htaccess.

            This page on Webmaster World might be worth reading.

            -Andy

            1 Reply Last reply Reply Quote 1
            • DA2013
              DA2013 Subscriber last edited by Aug 27, 2014, 12:37 PM Aug 27, 2014, 12:37 PM

              Thanks for the responses!

              @Kevin: Our main concern here is getting back that lost page rank, since javascript redirects don't pass page rank. We used http://www.internetofficer.com/seo-tool/redirect-check/ and _SEO Tools for Excel _to check whether the hashbang URL examples were using 301 redirects.

              The correct URLs are

              http://twitter.com/#!RobOusbey
              http://www.sherrilltree.com/Saddles/#!Saddles

              @iNetSEO

              These pages were indexed by Google before somehow, I suspect using escaped_fragment? the hashbang URLs would show up in search results

              Andy.Drinkwater spencerhjustice 2 Replies Last reply Aug 27, 2014, 1:54 PM Reply Quote 0
              • KevinBudzynski
                KevinBudzynski last edited by Aug 27, 2014, 12:27 PM Aug 27, 2014, 12:27 PM

                With the JavaScript option, people who bookmarked the page will get redirected.

                1 Reply Last reply Reply Quote 1
                • Andy.Drinkwater
                  Andy.Drinkwater last edited by Aug 27, 2014, 12:19 PM Aug 27, 2014, 12:19 PM

                  The hash tag means that the page wont be indexed by Google and therefore, carry no page rank. It is like it is invisible. Just launch the new pages because Google will have never seen the current ones.

                  -Andy

                  spencerhjustice 1 Reply Last reply Aug 27, 2014, 1:44 PM Reply Quote 1
                  • KevinBudzynski
                    KevinBudzynski last edited by Aug 27, 2014, 12:13 PM Aug 27, 2014, 12:11 PM

                    I may be wrong, but I don't believe you can do this via a 301 redirect. How did you know the examples used a 301 redirect? The examples provided may have used JavaScript to do it (may not be the best, but can't think of any other option).

                    1 Reply Last reply Reply Quote 1
                    • 1 / 1
                    1 out of 9
                    • First post
                      1/9
                      Last post

                    Got a burning SEO question?

                    Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                    Start my free trial


                    Browse Questions

                    Explore more categories

                    • Moz Tools

                      Chat with the community about the Moz tools.

                    • SEO Tactics

                      Discuss the SEO process with fellow marketers

                    • Community

                      Discuss industry events, jobs, and news!

                    • Digital Marketing

                      Chat about tactics outside of SEO

                    • Research & Trends

                      Dive into research and trends in the search industry.

                    • Support

                      Connect on product support and feature requests.

                    • See all categories

                    Related Questions

                    • MAdeit

                      Is there any benefit to changing 303 redirects to 301?

                      A year ago I moved my marketplace website from http to https. I implemented some design changes at the same time, and saw a huge drop in traffic that we have not recovered from. I've been searching for reasons for the organic traffic decline and have noticed that the redirects from http to https URLs are 303 redirects. There's little information available about 303 redirects but most articles say they don't pass link juice. Is it worth changing them to 301 redirects now? Are there risks in making such a change a year later, and is it likely to have any benefits for rankings?

                      Intermediate & Advanced SEO | Jan 21, 2019, 10:42 AM | MAdeit
                      0
                    • TaraLP

                      Will changing category URLs on site hurt SEO?

                      Hi Moz Community, We're looking to replace some URLs on our Wordpress site and I want to make sure we won't hurt our SEO with the changes. The site is lushpalm.com When we originally launched our site we created pages (which are linked to in our main menu) to essentially display our categories. We did this as a workaround because we didn’t like the URL to have the word “category” in it. Now we would like to make some changes and we want to make sure we’re not going to hurt our SEO in any way by accidentally duplicating content or otherwise. We want to fix our structure and now link to our category pages from our main menu, BUT we want to change the URL of the category page so that it doesn’t have “category” in it, essentially renaming it the name of the page currently linked to in our main menu. So basically, the category lushpalm.com/category/surf-trips, would be renamed with the URL lushpalm.com/surf-trips and the current page that is at lushpalm.com/surf-trips would be therefore replaced. My questions are: If we did this, would that mean that the previous “lushpalm.com/category/surf-trips” would cease to exist? Or is there some imprint of that out on the web? And if it is then would it re-direct to the new page? Would replacing the current page URL with a category hurt our current SEO in any way? Would this change cause any duplicate pages somehow? Thanks so much for your help!

                      Intermediate & Advanced SEO | Jul 29, 2021, 4:33 PM | TaraLP
                      1
                    • dsbud

                      301 redirect hops from non-https and www

                      It's best practice to minimize the amount of 301 redirect hops. Ideally only one redirect hop. It's also best practice to 301 redirect (or at least canonical) your non-https and/or your non-www (or www) to the canonical protocol/subdomain. The simplest (and possibly the most common) way to implement canonical protocol/subdomain redirects is through a load balancer or before your app processes the request. Both of which will just blanket 301 to the canonical domain/protocol regardless if the path exists or not In which case, you could have: Two hops. i.e. hop #1 http://example.com/foo to https://example.com/foo, hop #2 https://example.com/foo to https://example.com/bar 301 to a 404. Let's say https://example.com/dog never existed, but somebody for whatever reason linked to it (maybe a typo). If I request https://www.example.com/dog, the load balancer would 301 to a 404 page. Either scenario above should be fairly rare. However, you can't control how people link to you. Should I care about either above scenario? I could have my app attempt to check if the page exists before forwarding, but that code could be complicated.

                      Intermediate & Advanced SEO | Oct 20, 2017, 1:26 AM | dsbud
                      0
                    • rich.owings

                      Splitting and moving site to two domains - How to redirect

                      I have a client who is going to split their retail and wholesale business and rebrand the retail biz. So let’s say they are going to move everything from currentdomain.com to either retaildomain.com or wholesaledomain.com. The most important business for them is the retail site, so they want to pass on as much ranking power as they can from currentdomain.com to retaildomain.com. I see two choices here: We can 301 redirect all of currentdomain.com to retaildomain.com, and then redirect any wholesale pages to wholesaledomain.com. The advantage is that we can use GSC’s change of address tool to report the change to Google. The downside is that there is a redirect chain (2 hops) to wholesaledomain.com. Would this confuse Google? Or we can 301 redirect page by page from currentdomain.com to the appropriate page on either new site. This means no redirect chains but it also means that we can’t use GSC’s change of address tool. Which would you do and why? And is there another option that I'm missing? I appreciate any insights you can share.

                      Intermediate & Advanced SEO | Dec 22, 2015, 4:24 PM | rich.owings
                      1
                    • Townpages

                      .htaccess 301 Redirect Help! Specific Redirects and Blanket Rule

                      Hi there, I have the following domains: OLD DOMAIN: domain1.co.uk NEW DOMAIN: domain2.co.uk I need to create a .htaccess file that 301 redirects specific, individual pages on domain1.co.uk to domain2.co.uk I've searched for hours to try and find a solution, but I can't find anything that will do what I need. The pages on domain1.co.uk are all kinds of filenames and extensions, but they will be redirected to a Wordpress website that has a clean folder structure. Some example URL's to be redirected from the old website: http://www.domain1.co.uk/charitypage.php?charity=357 http://www.domain1.co.uk/adopt.php http://www.domain1.co.uk/register/?type=2 These will need to be redirected to the following URL types on the new domain: http://www.domain2.co.uk/charities/ http://www.domain2.co.uk/adopt/ http://www.domain2.co.uk/register/ I would also like a blanket/catch-all redirect from anything else on www.domain1.co.uk to the homepage of www.domain2.co.uk if there isn't a specific individual redirect in place. I'm literally tearing my hair out with this, so any help would be greatly appreciated! Thanks

                      Intermediate & Advanced SEO | Sep 16, 2013, 2:42 PM | Townpages
                      0
                    • Travis-W

                      Multiple 301 Redirects for the Same Page

                      Hi Mozzers, What happens if I have a trail of 301 redirects for the same page? For example,
                      SiteA.com/10 --> SiteA.com/11 --> SiteA.com/13 --> SiteA.com/14 I know I lose a little bit of link juice by 301 redirecting.
                      The question is, would the link juice look like this for the example above? 100% --> 90% --> 81% -->72.9%
                      Or just 100% -----------------------------------------> 90% Does this link juice refer to juice from inbound links or links between internal pages on my site? Thanks!

                      Intermediate & Advanced SEO | Dec 16, 2012, 6:14 PM | Travis-W
                      0
                    • seointern

                      301 redirect from .html to non .html?

                      Previously our site was using this as our URL structure: www.site.com/page.html. A few months ago we updated our URL structure to this: www.site.com/page & we're not using the .html. I've read over this guide & don't see anywhere that discusses this: http://www.seomoz.org/learn-seo/redirection. I've currently got a programmer looking into, but am always a bit weary with their workarounds, as I'd previously had them cause more problems then fix it. Here is the solution he is looking to do: The way that I am doing the redirect is fine. The problem is of where to put the code. The issue is that the files are .html files that need to be redirected to the same url with out a .html on them. I can see if I can add that to the 404 redirect page if there is one inside of there and see if that does the trick. That way if there is no page that exists without the .html then it will still be a 404 page. However if it is there then it will work as normal. I will see what I can find and get back. Any help would be greatly appreciated. Thanks, BJ

                      Intermediate & Advanced SEO | Oct 12, 2011, 5:20 AM | seointern
                      0
                    • tylerfraser

                      301 Redirect With A Message And Delay

                      Hello, I'd like to sell a site I own. I'd like the site to be redirected to the buyers site with a 301 redirect. But I'd like the viewer to be informed that the site was purchased by this company and they will be redirect in 5 seconds.I'd like for the redirect to be a complete 301 and pass as much linklove as possible. Are you familiar with how to do this? Thanks, Tyler

                      Intermediate & Advanced SEO | Jul 15, 2011, 8:13 PM | tylerfraser
                      0

                    Get started with Moz Pro!

                    Unlock the power of advanced SEO tools and data-driven insights.

                    Start my free trial
                    Products
                    • Moz Pro
                    • Moz Local
                    • Moz API
                    • Moz Data
                    • STAT
                    • Product Updates
                    Moz Solutions
                    • SMB Solutions
                    • Agency Solutions
                    • Enterprise Solutions
                    Free SEO Tools
                    • Domain Authority Checker
                    • Link Explorer
                    • Keyword Explorer
                    • Competitive Research
                    • Brand Authority Checker
                    • Local Citation Checker
                    • MozBar Extension
                    • MozCast
                    Resources
                    • Blog
                    • SEO Learning Center
                    • Help Hub
                    • Beginner's Guide to SEO
                    • How-to Guides
                    • Moz Academy
                    • API Docs
                    About Moz
                    • About
                    • Team
                    • Careers
                    • Contact
                    Why Moz
                    • Case Studies
                    • Testimonials
                    Get Involved
                    • Become an Affiliate
                    • MozCon
                    • Webinars
                    • Practical Marketer Series
                    • MozPod
                    Connect with us

                    Contact the Help team

                    Join our newsletter
                    Moz logo
                    © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                    • Accessibility
                    • Terms of Use
                    • Privacy

                    Looks like your connection to Moz was lost, please wait while we try to reconnect.