I have a gallery set up where all the large images appear to be on separate pages with unique urls. They're actually all the same page as far as etomite is concerned, with a parameter to indicate which image to show (the visible urls are partially decoded by .htaccess rules). This works fine until an image is removed from the gallery, but still has links and is 'known' to google etc.
At present I return the image page for the first image in the gallery ... this is less than ideal, as this seems to be random image to the user, and is 'duplicate content' for search engines which according to SEO gurus is definitely not desirable!
What I'd like to do is return a permanent redirect to the base gallery page. I've had a quick look at the sendredirect etomite function, but this doesn't seem to have specific capability for the necessary code. I guess its related to the 'type' parameter (which is undocumented) and I'm not sure what I need to do to send the correct header back. (I don't want to get it half right, and have the gallery page returned, but then have the gallery page penalised for 'duplicate content' issues!)
thanks
mike
send permanent redirect from a snippet
Started by
mikef
, May 28 2009 01:29 PM
5 replies to this topic
#1
Posted 28 May 2009 - 01:29 PM
#2
Posted 22 June 2009 - 03:26 PM
In the absence of any response, and since I can't think of a way of doing this without either editing index.php or aborting processing in the middle of a snippet, I'm logging the absence of this capability as a bug.
#3
Posted 22 June 2009 - 06:20 PM
Could you modify your snippet to pass a new header if the image doesn't exist (and therefore drop the listing), or would the index.php header override the one set within the snippet?
the thing is, if it's not done right there's a chance google could drop the page correctly - it's whether or not it detects variables in the address bar as pages... if it detects it as one page that's dynamic, isn't there a chance that google could drop the whole gallery??
be very careful.
p.s. i just realised that I may have completely gone off-base as to what you were meaning in your original post..
the thing is, if it's not done right there's a chance google could drop the page correctly - it's whether or not it detects variables in the address bar as pages... if it detects it as one page that's dynamic, isn't there a chance that google could drop the whole gallery??
be very careful.
p.s. i just realised that I may have completely gone off-base as to what you were meaning in your original post..
#4
Posted 22 June 2009 - 07:41 PM
Its because it has to be done right that I asked for advice, as the etomite function that seems to be the right one is undocumented and appears to lack the appropriate option.
I don't really want to do it in the snippet since to me that is architecturally wrong - the final exit should come from the etomite code, not from the middle of a snippet that has no idea what state the etomite core is in and whether any cleaning up is needed first. It may work now but cause difficult to resolve problems with a future version.
I may settle for the time being for just using canonical links - that would be an improvement on the current position, but still not really 'correct'.
All pages have what should appear to Google to be static page urls ... ie text.html, with no parameters. ( .htaccess decodes the text to provide the parameters for etomite.)
I don't really want to do it in the snippet since to me that is architecturally wrong - the final exit should come from the etomite code, not from the middle of a snippet that has no idea what state the etomite core is in and whether any cleaning up is needed first. It may work now but cause difficult to resolve problems with a future version.
I may settle for the time being for just using canonical links - that would be an improvement on the current position, but still not really 'correct'.
All pages have what should appear to Google to be static page urls ... ie text.html, with no parameters. ( .htaccess decodes the text to provide the parameters for etomite.)
#5
Posted 22 June 2009 - 08:49 PM
Yeah, I'm aware that the way Etomite is handling headers could be vastly improved... There should be a way to modify the header all the way till the end and only use the default if it hasn't been modified... That would definitely improve the flexibility...
#6
Posted 27 June 2009 - 01:27 PM
for the record, what I've done is to add this code to check the image number in the snippet that outputs the image and description
With firefox and google chrome this first outputs the page in which the image would appear, but without any image or description (so this should avoid a duplicate content penalty), and in a way lets the user see that the image no longer exists, and then outputs the page (gallery overview) that allows them to select a related image.
With IE7 the second page isn't output for some reason, but there are other things that aren't quite right with IE7 at the moment.
w3c.org seems to be haing some problems at the moment, so i can't check the generated HTML to be sure that's valid.
I think this will do for me
valid url: http://www.mikefinle...Dying Iris.html
invalid url http://www.mikefinle...__Bergamot.html
if (!$validtopimg) {
// the requested image isn't in the list - the old approach was to use the first image as 'relevant' but using the gallery is probably better
// provided it can be done safely for google scores
// galleries now have a 'canonical' link reference, so should be safe
$etomite->sendRedirect($gbaseurl, 3, "REDIRECT_REFRESH");
return;
}With firefox and google chrome this first outputs the page in which the image would appear, but without any image or description (so this should avoid a duplicate content penalty), and in a way lets the user see that the image no longer exists, and then outputs the page (gallery overview) that allows them to select a related image.
With IE7 the second page isn't output for some reason, but there are other things that aren't quite right with IE7 at the moment.
w3c.org seems to be haing some problems at the moment, so i can't check the generated HTML to be sure that's valid.
I think this will do for me
valid url: http://www.mikefinle...Dying Iris.html
invalid url http://www.mikefinle...__Bergamot.html
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











