Ajax url tree navigation
===

How would I go about making a site that uses ajax and history.pushstate? I know that on the page instead of linking you can call a script to ajax the page in and push the history but what about when someone types in the URL?

for example if I had a page at domain.com and someone typed in domain.com/profiles/3325/scott how would it know to go to domain.com and load in the data?