tags:

views:

35

answers:

2

I'm a fairly inexperienced web designer learning css/html on the fly for a company's web site.

I want to keep menus, banners, etc in one document so I don't have to repeat updates across many documents.

My solution was to make an index.aspx file with the menus and headers, then have a simple iframe for content. This works quite well and updates easily.

the format is:

  • www.site.com/index.aspx?page=page1.htm
  • www.site.com/index.aspx?page=page2.htm

The problem -- Google is indexing my iframe'd pages and linking to them directly:

  • www.site.com/page1.htm
  • www.site.com/page2.htm

How can I set up redirects to page1.htm forwards to index.aspx?page=page1.htm without creating a "hall of mirrors" effect inside the original iframe?

A: 

iframe for loading content addresses many usability issues. Your problem should be solved by a concept called "Template".

If you use Dreamweaver, just look at help document there about template, basically template is defining what is unchanged, and each page that use that template only define those changing properties. For dreamweaver, it will help you to generate the necessary files.

If you use ASP.net v2 (actually most hosting is using this), the concept is call Master pages. And it even support Master derive from master.

xandy
A: 

Simple answer, put this on your page, either inside the head or the body tag:

<script type="text/javascript">
if(top.location==location){
    top.location.href="index.aspx?page=page1.htm"
}
</script>

Complex answer, you really should get some sort of CMS system.

eBusiness