you cannot change what the user has set in the url, you want to make sure your links are talking about it. The only way to change the URL is by redirecting. you will need to use something like .htaccess files on apache to rewrite .php URLs to "friendly" urls.
browsers automatically detect details after # and go to that part of the page (if it exists). It does nothing for the server.
source
share