Forum Moderators: Robert Charlton & goodroi
Likewise if they type green widgets and visit my page, I would like to display only green widgets, and if they visit the page afresh (without the PHP looking at the referrer), it would show all widgets of any colour.
But I don't want to break any rules of 'cloaking' or whatever. Is it okay to do this?
Secondly I think you'd be better served by having two pages, one on red widgets and one on green widgets, rather than one page that you adapt. Seems like it gives you the same results you're looking for plus it seems like it would be easier to get ranked in Google.
But doesn't having two web pages defeat the advantages of a single dynamic page?
Unless you mean something like:
widgetpage.html?color=red
widgetpage.html?color=green
But I'm not so sure Google is so good at using dynamic pages like this where there's a "?" afterwards.
It's a shame Google sees it as cloaking, because there are good white-hat reasons why webmasters would want to tailor the page according to the Google keywords.
1 url serving content to different visitors = cloaking.
Dynamic pages served based on URL = OK.
Dynamic pages served based on referrer=cloaking.
Make sense? Nothing wrong with creating and serving content dynamically as long as you don't trigger the dynamic content based on referrer (actually, there's nothing wrong with that either, just that I suspect it crosses the SE guidelines).
So, no, this does not defeat the purpose of dynamic pages at all.
AFAIK, Google's fine with the page structure you're talking about.
The common way to deal with what you're struggling with is not to have one page (one URL) with differing content. It's to have seperate pages with seperate URLS (maybe the difference in the URL's is only the variables passed to it like ?color=red). Then seperately 301 redwidgets.html to ?color=red. Then publish all links to redwidgets.html. Visitors and SE's visit redwidgets.html and actually get served ?color=red; they visit greenwidgets.html and get served ?color=green.
Sorry if that's confusing - I think you're struggling with a very fine technical point - and am basically suggesting you're thinking about this wrong :). Forget the referrer.
Instead of using the 301 method to 'redirect' to the dynamic page, how about if I just link up the appropriate dynamic pages from a single 'root' page:
root.html with links to:
widgetpage.html?color=red
widgetpage.html?color=green
widgetpage.html?color=blue
Will Google treat those as equally as if I were to do your method with widgetgreenpage.html, widgetredpage.html, and widgetbluepage.html and redirecting them to the dynamic one?
I'd like a single page for everything for better unification. But otherwise, I like your idea (just gotta learn to do the redirecting business if there are any useful tutorials out there).