[Pro] Redirect child page to iFrame parent

I’m having difficulty with a part of my site (blog) which I produced in iWeb. It runs inside an iFrame on my FW produced site.

I would like to have an auto-redirect if anyone visits the page directly, i.e. so that it is not viewed without its iFrame. I’ve noticed this has been happening from my stats.

I have tried to use the following code via an html snippet/widget but it is not working. Can anyone suggest an alternative method?

An example of the pages that I would like to redirect would be :

http://www.grantsymon.com/blog/BlogInfo/BLOG/BLOG.html

should be viewed inside its iFrame, here :

http://www.grantsymon.com/e/blog.html

Any help MUCH appreciated as I’m waaayyy out of my depth here.

Grant


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That should work. You need to put this in the head of your iWeb pages, though, not the Freeway page.

Walter

On Mar 19, 2012, at 10:57 AM, grantsymon wrote:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

A more valid formatting of the script:

<script type="text/javascript">
if(top.location == window.location)){
	top.location.href = 'http://www.example.com/iframe.html';
}
</script>

A standards-loving browser might scoff (or worse) at the capitalized tag names and attributes, also language= is deprecated in script blocks.

Walter

On Mar 19, 2012, at 12:05 PM, Walter Lee Davis wrote:

That should work. You need to put this in the head of your iWeb pages, though, not the Freeway page.

Walter

On Mar 19, 2012, at 10:57 AM, grantsymon wrote:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter!

I think the problem has been getting the code into iWeb’s head. :slight_smile: It seems that widgets are put into some sort of frame. Perhaps it’s time to change from iWeb to something else for the blog pages.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Once again thanks Walter.

iWeb doesn’t allow you to put code in where you want it, even via the Widgets/HTML thingy, but I found a great little tool SEO for iWeb, which will apply to an entire site in an instant.

Once I’d removed your extra little bracket :slight_smile: :slight_smile: it works wonderfully!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options