Member Avatar for diafol

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.

Member Avatar for diafol

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

Member Avatar for diafol

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

commented: That's very interesting - thanks +3
Member Avatar for diafol

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.

Cheers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.