I have 2 sites, example.co.in and example.com, hosted on 2 different servers (I have all access details for both).

When someone accesses example.co.in/a/b.php?c=d, I want it to show the HTML of example.com/a/b.php?c=d

This site has to be search-engine-friendly, so I do not want to use an iframe, or even AJAX, since all the content has to be in the HTML - basically, example.co.in/a/b.php?c=d should output just the same HTML as example.com/a/b.php?c=d would.

I could use echo file_get_contents(example.com/a/b.php?c=d) in example.co.in, but that would mean a request goes from the example.co.in server to the example.com server, and then the output would come to the example.co.in server, which would then send it to the user. That could mean time delay, and also that I am using twice the bandwidth - since there is data transfer from both my servers.

Apache rewrite will change the URL, which I do not want to happen - I want people who browse example.co.in to stay on it.

I was wondering if any of the numerous experienced people on this forum would be able to suggest a solution . Thank you very much for your time!

Recommended Answers

All 2 Replies

Apache rewrite will change the URL, which I do not want to happen - I want people who browse example.co.in to stay on it.

Not exactly! AFAIK, there is an option in .htaccess by which we can rewrite URLS without any change in the URL itself.

@shubhamjain1: Thank you. That I think is only if it is internal URL rewriting (within the same site)/ If you are rewriting to a different website, then as far as I know you cannot keep the URL in the address bar the same.

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.