Fixing ajax url formatting for diverse urls, not catching history urls