Mobile app version of vmapp.org
Login or Join
Murray432

: How to make sure content of iframes get properly indexed along with the stem webpage I'm having a webpage (a stem URL) with several iframes inside it with slightly differing src. It's like

@Murray432

Posted in: #Iframe #RubyOnRails #Seo

I'm having a webpage (a stem URL) with several iframes inside it with slightly differing src. It's like a @book has_many :pages and each page is an iframe with serially increasing page_no.

How should I ensure that the content inside iframes are properly indexed and the STEM URL becomes the parent to all the src urls of pages underneath?

Oh yes, I'm happy to have all search engines look at the content do it properly.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray432

1 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

As far as I know, there is no way to have your HTML frame site get indexed the way you want. Google always indexes content at the URL of the child frame, not at the URL of the parent frame.

Lack of search engine support is one of the reasons that frames are so rarely used on the web. It is far more common to rely on server side technology to build a full page rather than to send it to users in parts.



Rather than rely on search engines to index different pages, you can use JavaScript to enforce your FrameSet. If you have navigation that is in a frame on the side, I have sometimes seen JavaScript used to add it back in. Let's say that a visitor lands on page3.html, it might have some JavaScript like this:

if (window.top == window.self) {
window.location = "http://example.com/frame.html#page3.html";
}


Then frame.html might have JavaScript to set the correct page based on the fragment identifier:

if(/^page[0-9]+.html$/.test(window.location.hash)) {
document.getElementById('frame-for-the-pages').src = window.location.hash;
}


Where frame-for-the-pages is the id assigned to that part of your frameset:

<frame id="frame-for-the-pages" src="page1.html">




There are also some newer tools from Google that you could try. It's been so long since everybody gave up on frames that I'm not sure that anybody has tried:

Rel canonical

Use rel canonical meta tags in each of the child frames to point back to the parent frame. These tags can cause Google to index content as if it were at a different URL. I would only do for cases in which the parent frame shows the child frame immediately (without the user having to click around to it.) Otherwise you run the risk of "cloaking": Having Google index content that isn't available to users easily which can draw a penalty from Google.

Crawlable AJAX

Frames are not much different than AJAX in so far as the content in the frame is dynamically fetched client side. It might be possible to apply the same crawlable AJAX techniques to frames: Create HTML snapshots of all your pages and serve them at _escaped_fragment URLs while having Google send visitors to the frame URL.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme