View Full Version : Hide my real url

08-19-2008, 07:26 AM
I have my own website which I self host. I also have another domain where I will serve more of my website, including a forum and classifieds. I want to hide or mask the url of the second domain name so people think they have never left my original domain.

Is this possible?

If so, how is this done?



Meant to add that the original site and the new site are both PHP

08-19-2008, 08:17 AM
You can't hide the url that is in the address bar.

You can, however, include the page with php from another server.

<?php include('http://your.other/site.htm'); ?>

And you can base this on the URL, if you want, like:

Then php can show that from the other server with:
<?php include('your.other.com/'.$_GET['p']); ?>

You could also do a complex set of pairs, like "page1"->"something.htm", if you wanted it to not have the real paths/names of the other server.

08-19-2008, 05:12 PM
Let the name calling begin.

I know this is a really thick thing to say, but, can you explain with a little more detail what you mean and how it would look to the visitors of my site?



08-19-2008, 05:27 PM
If you used his first idea. You'd have to have 2 sites. or perhaps 1 site, and a subdomain. Although that would not be hiding the url.

08-19-2008, 05:45 PM
You can look in using rewrite rules. Do you use one server to host more domains or are there more servers?

08-19-2008, 06:51 PM
Well, what I said pretty much explains how it would look.

On the first server, you would make an index page. In the url you would include the path/filename of the page you want to see on the other host. In your script you would just grab that variable from the url and display that on the page.

If I went to:

Then it would load exactly from:

If you used the code, and only this code, on your first server's index.php page:
<?php include('http://www.yoursecondserver.com/'.$_GET['p']); ?>

I can try to explain in more detail if you'd like, but that's basically it.

You could also do more things to the $_GET['p'] variable, like make it a word "page1" which corresponds to a path/filename, if you'd prefer, or just disallow protected pages (you'd make a list), etc.

Alternatively, you could look into using rewrite rules. (Server configuration-- google should explain more.)

08-24-2008, 07:25 PM
The short answer is no. It is not possible.

I'm not up for the longer answer. It involves one site acting as a proxy, and honestly, it's not worth it just for the sake of masking a url. Either build onto one site what you need in it's own interface, or live with separate urls.

08-24-2008, 07:33 PM
I know this isn't what your looking for but have you thought about using frames in html?

<FRAME SRC="URLofSECONDserver.html" NAME="main">

Your url will be visible if they view page source, but otherwise they'll just see what ever address you place the frames page on. Frames suck for many reasons including not being listed correctly on search engines but if it's only import to mask the url to the average idiot, what the heck.

Good luck