Advertisement
Guest User

replacestate to canonical

a guest
Jan 20th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #Update the URL that appears in the address bar to display the canonical URL
  2.  
  3. <script>
  4. $(document).ready(function() {
  5. if (canonical = $('link[rel=canonical]').attr('href'))
  6. history.replaceState('', '', canonical);
  7. });
  8. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement