Hi all, didn't know into which other forum this should be posted, none of them seemed obvious, so I've placed it here.
Here's my problem:

I've got a domain (www.example.com) registered with a host, let's call them 'smallhost', and I've got a website with my custom admin section there.

Recently a colleague built a fancy front end and placed it on our own web server. We've ensured that the front-end encapsulates the custom admin area with an iframe (seemed like the best idea at the time). The original homepage on 'smallhost' contains a header(Location:http//xxx.xxx.xx.xxx) statement (where x = our webserver IP address).

Now my colleague is a bit fussy (and rightly so) and doesn't like the website showing the IP address (he wants the www.example.com) to show in the address bar.

I've dropped all files except the homepage (now the redirect page) in the root folder (public html) but have all the admin files under subfolders.

Does anyone know of a painless way to get root urls of the hosted site to point to the local webserver (showing www.example.com) while allowing subfolder (custom admin area) access via iframe?

For example, if somebody entered www.example.com/map.php, they'd be redirected to the local webserver, but if they entered www.example.com/admin/index.php, they'd still come through to the hosted site.

I'd appreciate any help on this matter, I had a problem explaining myself to the host - she didn't or couldn't understand what I was getting at.

8 Years
Discussion Span
Last Post by diafol

Thanks for that P. Still trying to get my head around it.


OK, I follow what you're saying, but I need the reverse, that is, not redirecting anything in subfolders, just the top level urls (e.g. redirect www.example.com/about.php but not www.example.com/admin/login.php).

Sorry, I always get into a tizz with htaccess and expressions. I get brain freeze. I really appreciate the help thus far.


Check with your Domain Registrar if they provide free dns management as part of their service. Several Registrars do that.

If that is available, you can accomplish your job quickly.

Logon to your Registrar web site and go to DNS Management. Set hosts none and www to your local IP. Create another host 'admin' and point it to your host IP. Click Save and exit.

Once propagation completes, you will be able to see www.smallhost and smallhost coming from your local system and admin.smallhost will come from your web host.

You need a dedicated IP for your local machine and your machine must be connected to Internet all the time. A reserved IP like 192.168.xxx.xxx will not work

Votes + Comments
That's very interesting - thanks

Thanks sy, I was on the right track (I think!) - both you and Pri have saved me some trouble. I'll post back with any progress - got quite a bit to go on now.


This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.