homepage Welcome to WebmasterWorld Guest from 54.196.168.78
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Marketing and Biz Dev / Cloaking
Forum Library, Charter, Moderator: open

Cloaking Forum

    
script for static pages
need a script to avoid google cache
rominosj




msg:678351
 4:35 pm on May 7, 2004 (gmt 0)

Hello,

I am using a cloaker that allows me to create templates and static pages. The static pages I can create with HTML and my own copy.

I have read here at WebmasterWorld that I should not use the tag "<META NAME="ROBOTS" CONTENT="NOARCHIVE">" because it will be suspicious for the engines.

So, my questions is what script or iframe should I use? to redirect where? and where should I place it? Also, I would like to know if this script would prevent my cloaked page to be cached.

Thanks,

Romino

 

volatilegx




msg:678352
 5:17 pm on May 7, 2004 (gmt 0)

The only thing that will prevent an indexed page from being cached is the NOARCHIVE meta tag. You could possibly use a JavaScript to redirect visitors to another website, but such redirects are visible and it's possible Google and other SEs will detect them as well and penalize the page.

The NOARCHIVE tag is suspected as a warning flag to search engines, but it is only a suspicion. There is no evidence that Google or any other search engine singling out sites with the NOARCHIVE meta tag for further review.

vrtlw




msg:678353
 12:07 am on May 11, 2004 (gmt 0)

You need to call this script from an external file in the header of each page that you do not want to 'appear' as being cached. As long as the browser doesnt have JavaScript disabled then the user will not see the cached version.

<!-- hide
if (location.href.indexOf("cache")!= -1)
{
window.location.href="http://www.yourdomain.com/yourpage.html";
}
// end hide -->

volatilegx




msg:678354
 1:39 pm on May 11, 2004 (gmt 0)

Here's a question on a related topic...

Is there a way to generate a frameset on the fly in a document? Using the above JavaScript code, the URL would change in the location bar. If you were able to generate a frame on the fly, the URL wouldn't change and the person trying to view the cache of your cloaked page would be less suspicious.

isitreal




msg:678355
 2:43 pm on May 13, 2004 (gmt 0)

Yes, you could. An easy way to do this is with iframes and css, not frames, since frames require a different document structure.

Use

document.write('<div id="iframeContainer"><iframe src="non-cached-page-version.html"></iframe</div>');

In your css have the

body, html {
margin:0;
padding:0;
z-index:1;
}

div#iframeContainer {
width:100%;
height:100%;
z-index:30;
position:absolute;
top:0;
left:0;
}
iframe {
width:100%;
height:100%;
}

when the page is loaded and it's in the cache the javascript will write this out, then the iframe will be loaded within about 1 second or so, I haven't actually tested this exact version, you might have to set z-index for the cached content section also, play around with it and see, but this should work fine, I use a technique like this to take over a page on a bulleten board type thing.

volatilegx




msg:678356
 5:48 pm on May 13, 2004 (gmt 0)

Does your code wipe out the box Google has at the top of the cached page? Wouldn't want to do that...

I do like the idea :)

isitreal




msg:678357
 7:35 pm on May 13, 2004 (gmt 0)

Yes, I have a site where if you view the cached version of the page it takes over the whole page, goes over the google cache stuff, you'd have to experiment a bit with the positioning to find the sweet spot, slightly tricky however since you can't update the google cache page until google recaches your page.

It has to be absolutely positioned since you are trying to cover another part of the page, I think, it's hard to experiment with something like the google cache, although actually now that I think of it all you have to do is copy the html from a cached page, dump the content part, then construct a sample page using the above code, tweak the positioning til it works right. By my count if text size is normal the google cache part is about 205 px high, give or take, 200 would probably be safe, in that case make top: 200px; and it should theoretically line up decently, you'd also have to tweak the heights of the iframe, ideally it would be the document height.

Also, I forgot this, you need to set the background color for the iframe div container as white or whatever background color your site has, or else you'd see the cloaked content for a few seconds while the iframe loaded, possible anyway.

One possible way around the positioning might be to place your entire page, including the cloaked page, inside a div, make that div have position: relative, then put this sub div/iframe thing inside of that with position:absolute, I think that might work, since then the absolute positioning is relative to the container, not the google page. Now that I think about it, that would almost definitely work, maintaining the top:0 relative to the bottom of the google info section.

eg:

...google header page code, table etc....
<html><head><title></title></head>
<body>
<div id="mainRelativeDiv">
<script type="text/javascript">document.write('<div id="iframeContainer"><iframe src="non-cached-page-version.html"></iframe</div>');</script>
...your cloaked page html...
</div>
</body>
</html>
.. google footer page code....

Another thing you might be able to do is put the cloaked content in its own div, then have the same 'cache' detection write out some css that sets the div id container for the cloaked content to display:none, which would make it totally invisible to a viewer unless they looked at the source code. So many options with CSS.., that way if your cover iframe page ran shorter than your cloaked content you would never see the cloaked content....

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Marketing and Biz Dev / Cloaking
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved