|URL to stay domain name|
| 7:52 am on Feb 10, 2014 (gmt 0)|
I am new here, and hoping this has not been answered anywhere else. I have searched and could not find it. Apologies if it is.
Is there a way that I can make my PHP application not display the current path in the address bar?
So, what I want is for the address bar always display www.mydomainname.com but the page could actually be www.mydomainname.com/profile.php?id=295673
I know that using .htaccess could make it www.mydomainname.com/profile/295673 but that is not what I am looking for.
Any help is appreciated, thank you.
| 9:13 am on Feb 10, 2014 (gmt 0)|
Can't be done. The browser, and only the browser, decides what to put in the address bar, based on the information it has about the current URL. If the browser believes-- whether correctly or otherwise-- that it is at example.com/directory/pagename, the address it displays will reflect that belief.
Some browsers, notably mobiles, just show the domain name. Some leave off the "http(s)" part. Some show the complete URL. There are probably other permutations. (Wasn't there some discussion of this behavior, a few Firefoxes ago?)
| 9:29 am on Feb 10, 2014 (gmt 0)|
Thank you very much for your help Lucy24.
| 1:17 am on Feb 13, 2014 (gmt 0)|
You could use a frame/iframe if you really really wanted to do this. The address will be hidden from the address bar, but the user can find if they really want to. However, you should be aware of the negative aspects of doing this (bad user experience, unable to bookmark, bad for SEO, etc.) - but maybe that is not a concern?