URL Redirection: How to set Frame Forwarding for a domain?

What is Frame Forwarding and How it is set?

A few lines of Explanation:

Frame forwarding (redirection) of a domain is different than normal forwarding of a domain.

In Frame Forwarding, the visitors are redirected to another site, but the destination address is not displayed in the address bar, so they are not aware of the redirection as opposed to “Normal Forwading” (also called Parked domain).

InĀ Normal Forwading the web site visitors are redirected to another site and the destination address is displayed in the address bar, so the visitor is aware about the redirection.

For example, suppose the main website is abc.com and we frame forwarded xyz.com to it. When we access xyz.com, the URL in the address bar of the browser will stay as it is and the contents will be fetched from abc.com. The user won’t notice the redirection.

Solution:

Using the above domain names as example, in order to set Frame Forwarding for xyz.com, first add the domain on the server as we normally do and add the following code in the index.html file

<frameset rows="100%", *' frameborder=no framespacing=0 border=0> 
<frame src="http://www.abc.com/"></frame> 
</frameset>

This is it.

A Drawback of the above method and a Solution for it:

As you will be setting up a redirection in the index.html file, any other file/directory accessed using a direct URL ( i.e. for example: xyz.com/anyfilename) will result in a “404 Not Found” error.This is because the request will bypass the redirection set in the index.html file and will search for the file under the xyz.com itself.

To overcome this problem, add xyz.com as a “ServerAlias” in the VirtualHost entry of abc.com. Edit the Apache configuration

vi /etc/httpd/conf/httpd.conf

Search for the VirtualHost entry of abc.com and make sure the “ServerAlias” line look like the following

ServerAlias www.abc.com xyz.com www.xyz.com

Save the file and restart the Web server

service httpd restart

Now, directly accessing a file or directory of a target domain using the alias domain name will also work.

This entry was posted on Friday, October 15th, 2010 and is filed under Linux Administration. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.