Pages

Tuesday, June 30, 2015

Redirect webpage to other website without changing the URL in Browser - IIS

Problem :

 I was asked to redirect a Webpage , say www.x.com to another website www.y.com but client wanted to retain the first URL in the browser. Simple Redirection can be done via IIS redirection module but if we use simple redirection then the URL shown in the browser will be of the redirected page (in this case www.y.com). To over come this problem I applied following solution..


Solution : 


  1. Create an index.html file in the root folder of first website (which you want to redirect to other URL).. in this case www.x.com.
  2. Paste the following code in that index.html file
<html>
<frameset cols="100%">
<frameset rows="100%">
<frame src="www.y.com" />
</frameset>
</frameset>
</html>

3. Save the file.

4. In the IIS settings of the first website, make index.html as default document.

5. Restart the first website  (www.x.com) (though it is not needed).


You will now be able to redirect your page www.x.com to www.y.com but it will not change the URL in your browser.


Cheers !!!!!!!!!!!!!!