开发者

IFrame and SEO issue

开发者 https://www.devze.com 2022-12-17 06:51 出处:网络
I have some web site. There are some pages rendered using iframes to show page content instead of flat regular page. The reason is that before and after my content I show header and footer (some logo

I have some web site. There are some pages rendered using iframes to show page content instead of flat regular page. The reason is that before and after my content I show header and footer (some logo + basic html) of some other sites, which I can't change, and use iframes to prevent css problems (when header's and footer's css will override css from my pages). The problem is SEO: search engines don't like iframes. How can I solve this problem?

Example:

I have site: www.site1.com where all pages are flat (without iframes).

Also there is www.othersite.com, which contain:

  • [Header]
  • IFrame[My content]
  • [Footer]

and I have full access to www.othersite.com content except header and f开发者_Go百科ooter html.

How can I make my content on www.othersite.com available to search engines?


This is a pretty bad situation to be in.

If this is for any serious kind of project you need to unwravell this iframe issue and just get rid of them.

Its not that search engines can't use iframes, they can, but they index what is inside the iframe which in your case seems to be www.site1.com.

To get othersite in the search engines without removing the iframe might be possible but you will have to make a decision.

The idea

Put url rewriting on your iframe site (othersite.com) so that it will serve all the pages from site1.com. Use url rewriting not url redirects so that the page appears to be coming from the othersite.com.

Add a sitemap to othersite.com so that Google can find all these pages.

The decision

In order to avoid Google thinking othersite.com is just a clone of site1.com you are going to have to block site1.com from the search engines.

Block your site1.com from being indexed by using robots.txt

This will mean any google juice you have accrued such as page rank or ageing the domain etc will be lost. If this is a business that depends on the search engines for business you should think hard about this.

Conclusion

I have never tried this technique out its just an idea I have had to solve your problem.

Its not a pretty solution and not something you should go out of your way to do (if anyone else is reading this).

The best solution is for you to get rid of your iframes. If you have problems with not being able to control the html inside the header and footer frames then there are still better solutions than using an iframe.

For example, you could use HtmlAgilityPack to parse in the html that should be in these headers and spit it out into your template with altered ids so you can contain the css.


You can use meta tags and title tag to help search engines recognizing content of your page.

<meta name="description" content="Longer description of the content in the iframe">
<meta name="keywords" content="keyword1,keyword2,keyword3,foo,boo">
<title>Title of the page in the iframe</title>

There is also possibility to insert alternative content into iframe tag. This will be parsed by search engines and rendered only if iframes are disabled.

<iframe src="http://www.site1.com">Alternative content for SE and disabled iframes</iframe>

I think the best solution is to separete CSS of header,footer and content by encapsulating the parts with containers and selecting them only through container's id and then getting rid of iframes.

#header div.foo {/* some CSS here */}
#content div.boo {/* some CSS here */}
#footer div.moo {/* some CSS here */}
0

精彩评论

暂无评论...
验证码 换一张
取 消