MRKAVANA (mrkavana@gmail.com) - www.facebook.com/kavanathai

Aug 25, 2011

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 little different than normal forwarding of a domain. In Frame Forwarding, the web site visitors are redirected to another site, but the destination address is not shown, so they do not know about the redirection as opposed to “Normal Forwading” (also called Parked domain) where the web site visitors are redirected to another site and the destination address is shown, so they know 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.
Create a index.html file and add the following code
<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:
Now, one thing to notice is, since you are setting up a redirection using a index.html file, any 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” for abc.com. This is achived in the VirtualHost entry of the main domain. 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.

No comments:

Post a Comment