Frames and Redirection
Redirection for our purposes is the act of sending a browser to an alternate web page when a web page is loaded. This technique is very useful in the development of frames websites.
Let me give you some examples. Your frames website as I have stated several times is made up of two kinds of web pages. There are frameset pages and source pages.
One of your source pages is the header page, which contains nothing but your document heading or logo. Suppose by chance this page was indexed by a search engine. Someone clicks on the page in the SE results and all they see is your site heading.
If this happened, wouldn't you want the user to be redirected to your main frameset web page? Of course you would. So how is it done?
The Code
The code shown below is the handiest little piece of javascript I have ever found on the internet for creating frames websites:
<SCRIPT TYPE="text/javascript">
<!--
if (parent.location.href == self.location.href) {
if (window.location.href.replace)
window.location.replace('index.html');
else
// causes problems with back button, but works
window.location.href = 'index.html';
}
// -->
</SCRIPT>
Copy the code exactly as it is and paste it between the head and body section on your source page. Change the name of the web page that you want to redirect to in two locations. Don't touch anything else.
My main frameset page is named index.html, so this is the actual code that can be found on my header page, my links page and my footer page. If those pages should get indexed and someone clicks on them in the SE results, they will see my main frameset web page.
As I stated in the previous lesson, I use a two page system when I build frames websites. For every source page I create, I build a separate frameset web page. Why?
Suppose you put up your frames website and all of your pages get indexed. If a source page gets indexed and it doesn't have redirection code, it will be viewed as a static HTML document.
Why not just place the redirection code shown above and send it to the main frameset web page?
The default source page that is loaded in the middle-frame window of the main frameset web page is the content-index.html page. If all of your content pages were redirected to this frameset, it would require your user to begin a search of your website for the page that they had clicked on in the search results. Result - mass confusion!
Also, using that method, the only page that would be indexed on an SE would be that main frameset page.
Instead create a separate frameset page for each source page, identical to the main frameset page only use the source page as the default that is loaded when the page opens.
It sounds confusing, especially if its your first frames site, but after you've create a source page and then created a separate frameset for that source page and repeat the procedure a few times it becomes second nature.
You should also remember that the code from the source page goes in the noframes section of the matching frameset web page. Do remember to remove the redirection javascript from the noframes section.
Create a Website With Frames
What are frames?
The Frameset
Frames Source Pages
Frames Scrolling and Stuff
Noframes
Frames Redirection
The Frames Kit
Other Frames Resources
Contact Questions on How to Create a Website With Frames
Create a Website With Frames
What are frames?
Frameset Tag
Frames Kit
Noframes Tag
Frames and Redirection
Other Frames Resources
Frames Scrolling and other Attributes
Frames and Source Pages
Contact Questions on How to Create a Website With Frames
Copyright © 2008
Net Success 2000 Plus Inc
Somerset, KY, USA