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
-
When moving a site from HTTP to HTTPS, will i lose value from the 301 redirect?
I am looking at moving my site from HTTP to full HTTPS, so i will 301 redirect any HTTP requests to their HTTPS counterpart. All my pages in the Google index are HTTP, so will that 301 redirect reduce the value of the pages? Cheers
Intermediate & Advanced SEO | | SEOhmygod0 -
Can I undo 301 redirects to purchase site
A website I am thinking of buying has 301 redirected all pages on his site to one page that explains the site is closing down. If I tell him to change the 301 to 302s will I be able to recover the old pages on the site and keep the authority, rankings and link power of the old pages and not the "Closing page"? Is all i have to do is undo the 301 redirects and everything will go back to how the site was before the 301s were in place? Or will I lose all the link power on individual pages because they already transferred to the "Closing page"? Thanks!
Intermediate & Advanced SEO | | atomiconline0 -
Moving to a new domain name - 301 redirect NOT an option
Hi everyone My question concerns moving from an old to a new domain name without losing all previous SEO efforts. I am aware that a properly executed 301 redirect is the answer and way to go as well as telling Google about it in Webmaster Tools. However, what is the situation, if you do not own the old domain name anymore? If you have no means of getting back the old domain name and wanting to basically mask/switch the already existing website to the new domain name, will search engines penalise the "new site" as a duplicate, since the "old site" is still in the search engine rankings? I know that not being able to execute a proper 301 redirect and starting out with a new domain means a fresh start, but what is the best way to minimise the negative impact (if any)? Basically dropping the sites' current content and starting out new in favour of the new domain name is not really an option. Even if you were to take the content from the old site and place it on another site, this would surely be seen as duplicate too. Anyone thinks that Webmaster Tools/Google is savvy enough to spot the difference when the "old site" gets removed and the "new one" added instead (in Webmaster Tools). I read something along the lines about having your host point the DNS from the old site to the new one. Could something like be helpful? Thanks all in advance for your help and input!
Intermediate & Advanced SEO | | Hermski0 -
What to do about old urls that don't logically 301 redirect to current site?
Mozzers, I have changed my site url structure several times. As a result, I now have a lot of old URLs that don't really logically redirect to anything in the current site. I started out 404-ing them, but it seemed like Google was penalizing my crawl rate AND it wasn't removing them from the index after being crawled several times. There are way too many (>100k) to use the URL removal tool even at a directory level. So instead I took some advice and changed them to 200, but with a "noindex" meta tag and set them to not render any content. I get less errors but I now have a lot of pages that do this. Should I (a) just 404 them and wait for Google to remove (b) keep the 200, noindex or (c) are there other things I can do? 410 maybe? Thanks!
Intermediate & Advanced SEO | | jcgoodrich0 -
Too many 301 redirects?
Hey, My company currently has one chief website with about 500-600 other domains that all feature the same material as the chief website. These domains have been around for about 5 years and have actually picked up some link traffic. I have all of these identical web-pages utilizing rel=canonical but I was wondering if I would be better served, from SEO purposes, to 301 redirect all of these sites to their respective pages on our chief website? If I add 500 301 redirects, will the major search engines consider this to be black-hat link-building even though the sites are related and technically already feature the same content? For an example, the chief website is www.1099pro.com and I would 301 redirect the below sites to the chief site: 1099softwarepro.com 1099softwarepro.info 1099softwarepro.net 1099softwarepro.biz 1099softwareprofessionals.com 1099softwareprofessionals.info ...you get the point
Intermediate & Advanced SEO | | Stew2220 -
How to conduct catch 301 redirects & have the separate 301 redirects for the key pages
Hi, We've currently done a site migration mapping and 301 redirecting only the sites key pages. However two GWT (Google Webmaster Tools) is picking a massive amount of 404 areas and there has been some drop in rankings. I want to mitigate the site from further decline, and hence thought about doing a catch 301 - that is 301 redirecting the remaining pages found on the old site back to the home page, with the future aim of going through each URL one by one to redirect them to the page which is most relevant. Two questions, (1) can I do a catch 301 and if so what is the process and requirements that I have to give to the developer? (2) How do you reduce the number of increasing 404 errors from a site, despite doing 301 redirects and updating links on external linking sites. Note: The server is apache and the site is hosted on Wordpress platform. Regards, Vahe
Intermediate & Advanced SEO | | Vahe.Arabian0 -
Htaccess Redirect with %C2%A0 in URL
Below is my setup for redirects in .htaccess file in my root word press installation. The www to non-www works well, so no problems there Other page redirects work well, too (example: redirect 301 /some-page/ http://mysite.com/another-page/ (I didn't post those because I have a few too many : ) So here it goes... RewriteEngine On
Intermediate & Advanced SEO | | pepsimoz
RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L] BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule> END WordPress redirect 301 /archives/10-college- majors/ http://mysite.com/archives/10-college-majors/ redirect 301 /archives/10-college-%20majors/ http://mysite.com/archives/10-college-majors/ redirect 301 /archives/10-college-%C2%A0majors/ http://mysite.com/archives/10-college-majors/ I'm having a problem with the last 301 redirect: redirect 301 /archives/10-college-%C2%A0majors/ http://mysite.com/archives/10-college-majors/ not working... As you can see I've tried using other varations of the "space" but no go. I also used a redirect in cPanel's Redirect screen; testing all the possible options + wildcard I've also tried this: http://serverfault.com/questions/201829/using-special-characters-in-apache-mod-rewrite-rule (perhaps unsuccessfully, because it caused a 500 server error and it's a different situation in my case) I also saw something here: http://www.webmasterworld.com/apache/3908682.htm but I don't know if it works and how I would implement that + do so without compromising ALL other redirects. Note: the URL displays with a space in the address bar of all major web browsers: http://mysite.com/10-college- majors/ and goes to a 404 page I have a goregous page / PR6 / high authority site linking to the URL on my site, but they copied the URL with a space somehow. I contacted the person responsible for the website and he claims it works fine (aka he didn't check it). Is there a clean way to redirect ONLY this problematic URL without compromising other redirects, etc? Any ideas would be great. I'll respond with progress. Thanks in advance. UPDATE the redirect works, and it did work. Even so, when looking at source of page linking to mine, the URL looks like this: ``` http://mysite.com/archives/10-college- majors/ Clicking the URL in Source View in FireFox takes me to ``` http://mysite.com/archives/10-college-%C2%A0majors/ none of my 301 redirects should direct there. I don't have any redirect plugins either.0 -
Has anyone found a way to get site links in the SERPs?
I am wanting to get some site links in the serps to increase the size of my "space", has anyone found a way of getting them? I know google says that its automatic and only generated if they feel it would benifit browsers but there must be a rule of thumb to follow. I was thinking down the line of a tight catagorical system that is implimented throughout the site that is clearly related to the content (how it should be I guess)... Any comments, suggestions welcome
Intermediate & Advanced SEO | | CraigAddyman0