/ Zope / Apsis / Pound Mailing List / Archive / 2006 / 2006-12 / pound redirect status

[ << ] [ >> ]

[ pound: relocation error / Adam Andrzej Jaworski ... ] [ Alive URI / Francisco Ruiz ... ]

pound redirect status
Albert <pound(at)alacra.com>
2006-12-19 00:20:55 [ FULL ]
Currently pound does a 302 http redirects.  Is it possible to add a 
directive to use a different return code (for us, we need 301).  This 
might sound silly, but apparently, crawlers (at least google's) gives 
you a lower score if they see identical pages on 2 different urls.  For 
example, if you have www.mydomain.com/somepage and 
mydomain.com/somepage, then google will give a lower page score.  
Currently, we use IIS redirect to go from mydomain.com/somepage to 
www.mydomain.com/somepage (which is a 301).  I can do the same in pound 
(which would save a trip to my backend), but I get a 302 (which would 
cause the crawlers to keep coming back to the url, instead of moving 
permanently away to www address).  Any thoughts?
Attachments:  
text.html text/html 1208 Bytes

Re: [Pound Mailing List] pound redirect status
Adam <adam(at)host8.biz>
2006-12-19 01:26:47 [ FULL ]
Hello,

working with PHP as an example, the quick solution would be
to modify Pound source: in file "http.c" find and replace:

FIND:
"HTTP/1.0 302 Found\r\nLocation: %s\r\nContent-Type: 
text/html\r\nContent-Length: %d\r\n\r\n",
         url, strlen(cont));

REPLACE WITH:
"HTTP/1.1 301 Moved Permanently\r\nLocation: %s\r\nConnection: 
close\r\nContent-Type: text/html\r\nContent-Length: %d\r\n\r\n",
         url, strlen(cont));

and build new Pound binary


in PHP it is:
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$url);
header("Connection: close"); // this is to prevent 404 in MSIE


--
Kind Regards,
Adam Andrzej Jaworski
Host8Biz EU

Re: [Pound Mailing List] pound redirect status
Albert <pound(at)alacra.com>
2006-12-19 16:37:38 [ FULL ]
Hi Adam,

I can make the change in the source code, but I would have to apply this 
patch every time I want to update pound.  I was hoping this can be a 
parameter in the config file.

Adam wrote:[...]

Re: [Pound Mailing List] pound redirect status
Adam <adam(at)host8.biz>
2006-12-19 17:22:12 [ FULL ]
Hi Albert,

when I need 301 response, I am creating it in PHP,
to have it configurable in Pound, I think it should be
configurable not globally, but in BackEnd context,
and this means additional source code used for some
people and never used for most people, so it is always
the choice: to require everybody having never used
feature/code or to expect those who wants that feature
changing one (1) line in source with each upgrade,
and there is no "good for everyone" answer, I think,
however the smaller Pound remains, the better

just my 2 cents

Cheers,
Adam


On 2006-12-19, at 16:37, Albert wrote:
[...]


--
Kind Regards,
Adam Andrzej Jaworski
Host8Biz EU

Re: [Pound Mailing List] pound redirect status
Dave Steinberg <dave(at)redterror.net>
2006-12-19 17:30:39 [ FULL ]
> when I need 301 response, I am creating it in PHP,[...]

The option of either might be nice.  Might.
[...]

It all depends on the needs and demands on the developers.  The question 
I have is - who is pound for?  The developers, the user community, some 
commercial customers, or someone else entirely?

No matter what the answer is, feature requests combined with patches are 
surely the best way to elicit change.  They also make life easier if 
your change isn't accepted, b/c when its time to upgrade just download 
dist, apply local patches, and build.

Regards,[...]

MailBoxer