Url使用php和Javascript重写

I'm stuck with this.I have a page in my website like www.domainname.com/userhome.php?view=prsnl_pge&pge_id= 5 In that prsnl_pge.php with the help of window.history.pushState. I have change that towww.domainname.com/Page name. It works successfully.

But when I try to reload that page 404 error appears. Can anyone one help me to sort this out?