- Single page Application
- Send and Get response without a Browser Reload
- Adding hash (#!) towards the end of the URL
- Anything after #! is considered to change the page content.
- Browser able to navigate between forward and backward using the hash (#)
- Example : Twitter used #! before
Ajax Canonical Tag
<link rel="canonical" href="http://example.com/ajax.html#!foo=123" />
<link rel="canonical" href="http://example.com/ajax.html?_escaped_fragment_=foo=123" />.
XML Sitemap Creation
- While creating a sitemap , make sure all the Ajax URL’s with #! are included
Where to use #! hashbang in Ajax page
Anything that user sees
- All Hyperlinks
Caution : Do not use : _escaped_fragment_ in the URL, where the user could see.
robots.txt to block a hash fragment
- Considering this is the fragment to block : #DONOTCRAWLthefragment
Using Headless Browser?
Example Browser : htmlunit
- and there are few alternatives like NicelyResynchronizingAjaxController
You could use pubshState() to change the URL without #! and it will look like a normal URL .
history.pushState([data], [title], [url]);