dpc Posted November 10, 2008 Share Posted November 10, 2008 Hi, I want to be able to hide the address the browser shows for a web site. For example, I want a domain such as domain.com to display in the browser but then load up in the page (in frames or similar) mydomain.com. I've looked at frames but they still show you the address in the status bar and the properties of the page will still be of mydomain.com. I've also looked at mod_rewrite but it still shows mydomain.com after clicking a link or visiting an address. Am I able to accomplish this using PHP? I've looked at base64 encode and decode functions but I'm unsure as to how to use these best. Any ideas/links would be appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/132125-hiding-url-in-browser-address-bar/ Share on other sites More sharing options...
runnerjp Posted November 10, 2008 Share Posted November 10, 2008 i dont think it can be done ... infact why would you want it done as it makes it very bad for browsing your website and for search engins Link to comment https://forums.phpfreaks.com/topic/132125-hiding-url-in-browser-address-bar/#findComment-686626 Share on other sites More sharing options...
rhodesa Posted November 10, 2008 Share Posted November 10, 2008 you could use an iframe, but they can always right click on the iframe and get the 'real' URL you could also use cURL or even the file functions to get the contents of a remote page, and redisplay it, but you will have lots of problems finding images paths, etc Link to comment https://forums.phpfreaks.com/topic/132125-hiding-url-in-browser-address-bar/#findComment-686656 Share on other sites More sharing options...
The Little Guy Posted November 10, 2008 Share Posted November 10, 2008 100% not possible. You can use javascript to do some tricks, but the user can always look in the source, and not all tricks work on all browsers. Link to comment https://forums.phpfreaks.com/topic/132125-hiding-url-in-browser-address-bar/#findComment-686660 Share on other sites More sharing options...
thebadbad Posted November 10, 2008 Share Posted November 10, 2008 If the initial website is yours, you can try what rhodesa suggests. I've got a function to convert relative paths to absolute (to deal with the problem rhodesa points out), that can be used together with e.g. file_get_contents() or cURL, for a pure PHP approach. But it would be tricky to make the user able to browse the 'external' website while still staying on your site. Link to comment https://forums.phpfreaks.com/topic/132125-hiding-url-in-browser-address-bar/#findComment-686681 Share on other sites More sharing options...
The Little Guy Posted November 10, 2008 Share Posted November 10, 2008 You could possibly do it via flash. Link to comment https://forums.phpfreaks.com/topic/132125-hiding-url-in-browser-address-bar/#findComment-686683 Share on other sites More sharing options...
rhodesa Posted November 10, 2008 Share Posted November 10, 2008 curiosity: what are you trying to accomplish by the way? Link to comment https://forums.phpfreaks.com/topic/132125-hiding-url-in-browser-address-bar/#findComment-686688 Share on other sites More sharing options...
dpc Posted November 10, 2008 Author Share Posted November 10, 2008 I'm a relative novice in PHP so was just looking for some pointers really. I had the idea originally of domain.com/file.php?url=base64encoded but couldn't seem to figure it out I will investigate cURL and file_get_contents() some more. Thankyou very much for your input everybody. Basically, I have a number of websites, and I would like to display the contents of one through another, but I don't want the two websites to seem to be affiliated for commercial reasons. I could always copy everything from one site to another but I wondered if there was another way as the sites are frequently updated independently of each other. Long-term we are looking to use the same database with different 'white-label' front-end sites but that's not feasible in the short term Link to comment https://forums.phpfreaks.com/topic/132125-hiding-url-in-browser-address-bar/#findComment-686764 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.