Fantastic. This is a perfect way to get around the issue. Thanks for your help! Phil
On Tue, Aug 7, 2012 at 6:27 PM, hyperflame <[email protected]> wrote: > If crawlers are requesting deals/deals/deal-name instead of deals/deal- > name, that means that someone is linking to your site ( or you're > linking to your own site ) with the first method. You might want to > double check that your internal links, and any links that you're > promoting, are correctly written. It's easy to accidentally do this, > especially when you're using relative links. > > If you can't find anything wrong, then you can write some code into > your Deal servlet to correctly route the request. Use getRequestURI > ( > http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getRequestURI() > ) to get the path the request used. If you find "deals" twice in the > path, you can issue a 301 Moved Permanently, then redirect the client > to deals/deal-name appropriately. Crawlers won't penalize you for a > 301. > > On Aug 7, 8:04 pm, Phil McDonnell <[email protected]> wrote: > > Apparently, I am creating infinite sub-directories from a web crawler's > > perspective due to a wildcard I have in my web.xml. I have a single jsp > > file that dynamically handles all requests to the directory > > mysite.com/deals/*. The goal here was for the jsp to handle > > mysite.com/deals/some-deal-name-here. However, crawlers apparently are > > also picking up on mysite.com/deals/deals/some-deal-name-herewhich > > unfortunately looks like duplicate content from a web crawler > > perspective. This is not good for search ranking. Is there a way to > > configure my web.xml in order to stop this from happening? > > > > *Here's what I have in my web.xml:* > > <servlet-mapping> > > <servlet-name>deal</servlet-name> > > <url-pattern>*/deals/**</url-pattern> > > </servlet-mapping> > > <servlet> > > <servlet-name>deal</servlet-name> > > <jsp-file>/deal.jsp</jsp-file> > > </servlet> > > > > *Here's what I tried to fix it:* > > <servlet-mapping> > > <servlet-name>deal</servlet-name> > > <url-pattern>*/deals/[a-z0-9_A-Z-]**</url-pattern> > > </servlet-mapping> > > <servlet> > > <servlet-name>deal</servlet-name> > > <jsp-file>/deal.jsp</jsp-file> > > </servlet> > > > > Any ideas for other ways to potentially configure this? > > > > Thanks, > > Phil > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
