Re: routing — duplicate content and SEO concerns
This changes things/makes it easier from a development standpoint: http://www.seomoz.org/blog/canonical-url-tag-the-most-important-advancement-in-seo-practices-since-sitemaps http://www.seomoz.org/blog/canonical-url-tag-the-most-important-advancement-in-seo-practices-since-sitemaps RyOnLife wrote: > > > jon, yeah, makes sense re: beforeFilter() > > If anyone has insights into how to work this code into the router, I'd > appreciate your commentary. If not, I'll start dropping it into my > controller methods. > > > > -- View this message in context: http://n2.nabble.com/routing-%E2%80%94-duplicate-content-and-SEO-concerns-tp1605804p2518771.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
jon, yeah, makes sense re: beforeFilter() If anyone has insights into how to work this code into the router, I'd appreciate your commentary. If not, I'll start dropping it into my controller methods. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
Hi RyOnLife > Your idea of 301ing to the correct page is better than my thought of > 404ing. I think you'd need a 404'er as well, as this is only for items that exist but have mangled urls. I'm also thinking of extending it to cover past urls, like a URL history per item so I can 301 from an old url to the new - but that's a bit more involved. > I don't like the idea of having to paste the seoCheck() into > all of my controller methods, I know what you mean. But in actual fact I often only ever have a couple of methods per controller that require this, as most things are routed to just a couple of places: index view So even on a vaguely complex site with articles, pages, products I reckon I'd only need to call that method 6 times. I wouldn't want it in beforeFilter as there's more methods that not want it than would (admin, things used by requestAction etc etc). > so could we work this into beforeFilter I decided to just use func_get_args(), which you can't use from a different method, it's own args take precedence! I think the router is the place for this, but it was more a proof of concept than anything, and I\m using it now on a live site (only needed to place it in 2 methods, and it has 2 core tables, pages and articles). Cheers, Jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
@AD7six: Would you mind expanding on that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
On Dec 17, 8:06 pm, RyOnLife wrote: > Thanks, that's actually much along the lines of what I was thinking. > Your idea of 301ing to the correct page is better than my thought of > 404ing. I don't like the idea of having to paste the seoCheck() into > all of my controller methods, so could we work this into beforeFiler > ()? Something like... > > $method = new ReflectionMethod($this, $controllerMethod); > $allowedArgs = $method->getNumberOfParameters(); > $this->seoCheck($funcArgs, $allowedArgs, $baseUrl); > > Problem is, how do values for $controllerMethod, $funcArgs and > $baseURL get set in beforeFilter()? Why don't you look at the router... hint: if (the url != what the router things is the url for this- >passedArgs) { it's not the right url } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
Thanks, that's actually much along the lines of what I was thinking. Your idea of 301ing to the correct page is better than my thought of 404ing. I don't like the idea of having to paste the seoCheck() into all of my controller methods, so could we work this into beforeFiler ()? Something like... $method = new ReflectionMethod($this, $controllerMethod); $allowedArgs = $method->getNumberOfParameters(); $this->seoCheck($funcArgs, $allowedArgs, $baseUrl); Problem is, how do values for $controllerMethod, $funcArgs and $baseURL get set in beforeFilter()? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
> function demo($arg1, $arg2) { > $args = func_get_args(); > $arg3 = $args[2]; > > } how about a method which checks the expected number of methods and redirects to that with a 301 if you have more than the expected? // App controller method public function seoCheck($funcArgs=null, $allowedArgs=null, $baseUrl='/') { // check for some values if (isset($funcArgs) && isset($allowedArgs)) { // check if more than the allowed args were pass if (count($funcArgs) > $allowedArgs) { // extract just the args we want $argsForRedirect = array_slice($funcArgs, 0, $allowedArgs); // redirect $this->redirect($baseUrl.join('/', $argsForRedirect), 301); // kill function exit; } } } // controller method, called with custom route: /article/{id}/{slug} public function view($id=null, $slug=null) { $this->seoCheck(func_get_args(), 2, '/article/'); } // controller method, called with default route: /controller/method/{id} public function view($slug=null) { $this->seoCheck(func_get_args(), 1, '/pages/view/'); } Not sure how this fairs with named parameters etc though. hth jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
function demo($arg1, $arg2) { $args = func_get_args(); $arg3 = $args[2]; } On Dec 17, 3:44 pm, RyOnLife wrote: > This issue has remained at the back of my mind, and I think I have a > really simple solution. I need one question answered first: > > examples_controller.php has a function: demo($arg1, $arg2) { ... } > call up this URL: /examples/demo/val1/val2/val3 > > Inside the controller logic for demo(), how can I retrieve 'val3'? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
This issue has remained at the back of my mind, and I think I have a really simple solution. I need one question answered first: examples_controller.php has a function: demo($arg1, $arg2) { ... } call up this URL: /examples/demo/val1/val2/val3 Inside the controller logic for demo(), how can I retrieve 'val3'? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
Re: #1 Good point. Re: #2 I'll probably back burner it for now, but suppose I did want to 404/301, only way to do it is in the controllers right? No easy way to do it in routes.php? -- View this message in context: http://n2.nabble.com/routing-%E2%80%94-duplicate-content-and-SEO-concerns-tp1605804p1607600.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
1) I don't think it's a big problem. What about querystrings? Are you going to restrict all unknown querystring parameters as well, because Google doesn't ignore querystrings - just think of youtube urls and the myriad of sites built with "non-seo" urls. 2) If you *really* need to do something, instead of issuing a 404, I would issue as 301 permanent redirect which would help your rankings more than a 404. On Dec 3, 9:14 am, RyOnLife <[EMAIL PROTECTED]> wrote: > Why would anyone do that? It's a known black hat SEO tactic, among others > aimed at sabotaging competition as a means to improve one's own ranking. Not > that I have particular reason to be concerned that anyone is specifically > out to get me, but: > > a.) It's still bothersome that the exposure is there. > > b.) It just feels wrong to have an unlimited number of duplicate content > URLs, whether or not anyone actually links to them. I'd draw a parallel to > how, from a programming standpoint, breaking MVC patterns feels wrong and > should be avoided. This wrongness feels the same to me from an SEO > standpoint, and I have a solid online marketing background. It's just bad > practice to have duplicate content floating around different URLs. > > c.) To add a little more meat to my argument, I just checked out > Wordpress—the mature and very SEO-friendly CMS platform—and found it is > impervious. > > To Adam and everyone else, two questions: > > 1.) What do you think about the issue? Problem or not? > > 2.) Ideas for the best solution? > > —Ryan > -- > View this message in > context:http://n2.nabble.com/routing-%E2%80%94-duplicate-content-and-SEO-conc... > Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
Why would anyone do that? It's a known black hat SEO tactic, among others aimed at sabotaging competition as a means to improve one's own ranking. Not that I have particular reason to be concerned that anyone is specifically out to get me, but: a.) It's still bothersome that the exposure is there. b.) It just feels wrong to have an unlimited number of duplicate content URLs, whether or not anyone actually links to them. I'd draw a parallel to how, from a programming standpoint, breaking MVC patterns feels wrong and should be avoided. This wrongness feels the same to me from an SEO standpoint, and I have a solid online marketing background. It's just bad practice to have duplicate content floating around different URLs. c.) To add a little more meat to my argument, I just checked out Wordpress—the mature and very SEO-friendly CMS platform—and found it is impervious. To Adam and everyone else, two questions: 1.) What do you think about the issue? Problem or not? 2.) Ideas for the best solution? —Ryan -- View this message in context: http://n2.nabble.com/routing-%E2%80%94-duplicate-content-and-SEO-concerns-tp1605804p1606539.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routing — duplicate content and SEO concerns
There is only a *problem* if there are links to the above urls. Why would anyone do that? On Dec 3, 6:24 am, RyOnLife <[EMAIL PROTECTED]> wrote: > With some simple routing: > Router::connect('/items/*', array('controller' => 'items', 'action' => > 'view')); > > URLs like this are possible:http://domain.com/items/slug-here > > The problem, is that these are also valid pages that exactly duplicate the > above > page:http://domain.com/items/slug-here/unlimitedhttp://domain.com/items/slug-here/unlimited/duplicatehttp://domain.com/items/slug-here/unlimited/duplicate/urls > > What is the best way to address this issue so that there is not a duplicate > content problem? > > In each controller action, I could check to see how many parameters were > passed, and if there are more than expected, redirect to a 404. Seems like > there should be a way to handle this in the routes.php file though. > -- > View this message in > context:http://n2.nabble.com/routing-%E2%80%94-duplicate-content-and-SEO-conc... > Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
routing — duplicate content and SEO concerns
With some simple routing: Router::connect('/items/*', array('controller' => 'items', 'action' => 'view')); URLs like this are possible: http://domain.com/items/slug-here The problem, is that these are also valid pages that exactly duplicate the above page: http://domain.com/items/slug-here/unlimited http://domain.com/items/slug-here/unlimited/duplicate http://domain.com/items/slug-here/unlimited/duplicate/urls What is the best way to address this issue so that there is not a duplicate content problem? In each controller action, I could check to see how many parameters were passed, and if there are more than expected, redirect to a 404. Seems like there should be a way to handle this in the routes.php file though. -- View this message in context: http://n2.nabble.com/routing-%E2%80%94-duplicate-content-and-SEO-concerns-tp1605804p1605804.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---