Best way to redirect users back to the pretty URL who land on the _escaped_fragment_ one?

Best way to redirect users back to the pretty URL who land on the _escaped_fragment_ one? - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Best way to redirect users back to the pretty URL who land on the _escaped_fragment_ one? error on your web browser. Problem :


I am working on an AJAX site and have successfully implemented Google's AJAX recommendation by creating _escape_fragment_ versions of each page for it to index.



Thus each page has 2 URLs:




  • pretty: example.com#!blog

  • ugly: example.com?_escaped_fragment_=blog



However, I have noticed in my analytics that some users are arriving on the site via the "ugly" URL and am looking for a clean way to redirect them to the pretty URL without impacting Google's ability to index the site.



I have considered using a 301 redirect in the head but fear that Googlebot might try to follow it and end up in an endless loop.



I have also considered using a JavaScript redirect that Googlebot wouldn't execute but fear that Google may interpret this as cloaking and penalize the website.



Is there a good, clean, acceptable way to redirect real users away from the ugly URL if for some reason or another they end up arriving at the site that way?


Solution :

The appropriate way to do this is to use the the rel=canonical attribute on your page. This will identify one source URL for your content.



For example:



<link rel="canonical" href="http://blog.example.com/dresses/green-dresses-are-awesome" />


Google acknowledges this issue in a write up found here:
https://support.google.com/webmasters/answer/139066?hl=en



It basically explains that they expect multiple URLs, but they also would prefer that the webmaster indicate the best URL for a given page.



You should not need to redirect at this point, but if it is for aesthetic reasons, use a non-permanent redirect, such as a 302 or 303 redirect.




I have also considered using a JavaScript redirect that Googlebot wouldn't execute but fear that Google may interpret this as cloaking and penalize the website.




I would still use the JavaScript redirect approach. I don't think it would be considered cloaking because:




  • You show that JavaScript to all user agents (cloaking is doing something special just for Googlebot).

  • The same content gets shown at the target of the redirect (so you are not doing anything sneaky).



Make sure that both the pages have the pretty URL as there canonical URL



e.g. a tag in the header like



Then you don't really need to worry as Google will take both the pages as the same and only index and show the one with the nice URL, but combine all the nice link juice.



See https://support.google.com/webmasters/answer/139066?hl=en



For the end users then teh only real way is a 301.
If you use a 301 if shouldn't cause a loop if you redirect from the ugly to the pretty.


We hope that this article has helped you resolve the seo, redirects, google-search error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=