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
-
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.
-
The solution I came up with was:
- Create a list of all the source URLs you have, and all the destination URLs you want
- Create all the destination URL pages
- 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)
- Implement 301 Redirects for the Ugly URLs
- Deploy a Sitemap with Pretty URLs
- Submit Your Sitemap to Google Webmaster Tools
- Wait for Google to re-index all your pages
- Check that the new URL(s) show up in Google search results too
- 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.
-
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.
-
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.
-
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
-
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
-
With the JavaScript option, people who bookmarked the page will get redirected.
-
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
-
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).
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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.
Related Questions
-
Will URLS With Existing 301 Redirects Be as Powerful As New URLS In Serps?
Most products on our site have redirects to them from years of switching platform and merely trying to get a great and optimised URL for SEO purposes. My question is this: If a product URL has alot of redirects (301's), would it be more beneficial to me to create a duplicated version of the product and start fresh with a new URL? I am not on here trying to gain backlinks but my site is tn nursery dot net (proof:)
Intermediate & Advanced SEO | | tammysons
I need some quality help figuring out what to do.
Tammy0 -
Redirecting an Entire Site to a Page on Another Site?
So I have a site that I want to shut down http://vowrenewalsmaui.com and redirect to a dedicated Vow Renewals page I am making on this site here: https://simplemauiwedding.net. My main question is: I don't want to lose all the authority of the pages and if I just redirect the site using my domain registrar's 301 redirect it will only redirect the main URL not all of the supporting pages, to my knowledge. How do I not lose all the authority of the supporting pages and still shut down the site and close down my site builder? I know if I leave the site up I can redirect all of the individual pages to corresponding pages on the other site, but I want to be done with it. Just trying to figure out if there is a better way than I know of. The domain is hosted through GoDaddy.
Intermediate & Advanced SEO | | photoseo10 -
Is Google creating rich snippets for you? Example inside
Hi MOZ! How are ratings and reviews rich snippets are showing in search for "sephora Urban Decay Naked On The Run" when they don't have that data in their structured data? -- verified with Google Structured Data Testing Tool http://www.google.com/webmasters/tools/richsnippets?q=http%3A%2F%2Fwww.sephora.com%2Fartist-shadow-P387670Thanks for reading!
Intermediate & Advanced SEO | | DA20130 -
301 Redirecting an Entire Site
I have a question which has had me thinking for hours..... If SITE A is ranking well on a number of search phrases and you 301 that site to another (SITE B). The site will change on the Google SERPs to the site which you've re-directed to... In this case SITE B. But how do you maintain the rankings of SITE A?. Do you keep the rankings of SITE A forever? Or will your rankings of SITE A (now SITE B) gradually slip as other sites rank higher? As you can no longer edit SITE A does Google take into consideration the content on SITE B and no longer take anything that SITE A had to offer into consideration? SITE B has simply replaced it in the SERPs??...... Please can anybody help? Thanks,
Intermediate & Advanced SEO | | karl620 -
Is there anything wrong with this 301 redirect?
I'll keep this one short and sweet 🙂 Many moons ago we used to have several different methods of sorting our products and this change in sort order was achieved by having ?dispmode=list or ?dispmode=grid after the product URL. Best part of a year ago we decided to scrap this feature and 301'd all the ?dispmode URL's back to the base URL. The funny thing is that Google don't seem to have dropped a single one of the old URL's from their index and a search for site:www.refreshcartridges.co.uk dispmode returns almost 8,000 results. This isn't a massive problem but I'd have expected in the past year they'd have picked up on a couple of the 301's and would have started removing the old results. I'd hate to think we were getting any kind of penalisation for duplicate pages. I know the answer to this question is going to be 'just be patient, the old results will disappear' but just to ensure we're not missing anything stupid. I'd really appreciate it if someone could check out www.refreshcartridges.co.uk/brother-c-223.html?dispmode=list to confirm there's nothing more we could be doing to get these old results removed from the index. Many thanks
Intermediate & Advanced SEO | | ChrisHolgate0 -
Redirecting Existing Domains to My Main Site
Hi I have a main property related website featuring different countries around the world. I also have many different seperate country websites 20+. All keyword rich domains with a good 9 years+ domain age and PR3's with decent links and moz rankings and unique content. Many of the sites are very low Alexa rank now and receive little traffic. I don't have the time now to spend on each of the individual domains and am wanting to consolidate them and their PR juice to the corresponding country page of my main website. My question is - is it possible - will google see this as me trying to manipulate them and is my main site likely to suffer from any penalties or downgrading? Thanks for your input.
Intermediate & Advanced SEO | | freecall0 -
Targeting Keywords at Home page or 301 URL?
Background info This is a new site and I am using Wordpress for a CMS not a blog and I have set a static page as the home page. The problem is when I configure the home page as a static page in wordpress it sets a 301 redirect to that page, which is this domain.com/software-consultancy (so the software-consultancy page is now domain.com). I thought about creating a separate Home page but I didn't see the point as the pages would be almost identical. **"Should I target keywords to the home page?" ** If I start link building using the phrase "software consultancy" to the home page should I link to domain.com or the 301 redirect URL domain.com/software-consultancy ? My thoughts are that if the URL has the keywords I am targeting in it will help with SEO. Or should I create a separate home page and just link the company name back to the home and have a separate page for "software consultancy" my thought is that having exactly what the company does on the home page would be better. But I don't want to lose out on search engine traffic by not having the keywords in the URL I am going to be link building for. I guess if I link build to the 301 redirect URL I can always revert back to this URL if I want to change? FYI here is my site structure: The site is for a small software consultancy and I have the following structure: domain.com/software-consultancy -- (Set as Wordpress static Page so essentially a 301 redirect to / ) domain.com/software-consultancy/areas domain.com/software-consultancy/areas/london domain.com/software-consultancy/areas/new-york I would really appreciate some feedback on this, even if it's experience / advice and there is no exact answer. Many Thanks, J
Intermediate & Advanced SEO | | SEOKeith0 -
301 Redirect All Url's - WWW -> HTTP
Hi guys, This is part 2 of a question I asked before which got partially answered; I clicked question answered before I realized it only fixed part of the problem so I think I have to post a new question now. I have an apache server I believe on Host Gator. What I want to do is redirect every URL to it's corresponding alternative (www redirects to http). So for example if someone typed in www.mysite.com/page1 it would take them to http://mysite.com/page1 Here is a code that has made all of my site's links go from WWW to HTTP which is great, but the problem is still if you try to access the WWW version by typing it, it still works and I need it to redirect. It's important because Google has been indexing SOME of the URL's as http and some as WWW and my site was just HTTP for a long time until I made the mistake of switching it now I'm having a problem with duplicate content and such. Updated it in Webmaster Tools but I need to do this regardless for other SE's. Thanks a ton! RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
Intermediate & Advanced SEO | | DustinX0