Another htaccess

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lesliekirk
    Super Moderator











    • Aug 2008
    • 9290

    #1

    Another htaccess

    Maybe we need to set up a forum just for all the htaccess questions I ask

    Old store was using a third-party module to create the SEO short-links. New store is able to use the built in SEO Settings to produce the following short style

    Code:
    http://www.domain.com/page/store_code/PROD/product_code
    This is the style the store has been using for years and years. But somewhere the search engines are finding this link style:

    Code:
    http://www.domain.com/Merchant2/merchant.mvc?Screen=PROD&Product_Code=product_code
    The SEO Settings has inserted this rewrite for the product URL

    Code:
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^page/([^/]+)/PROD/([^/]+)$ /Merchant2/merchant.mvc?Store_code=$1&Screen=PROD&Product_code=$2 [QSA,L]
    and I "think" this one is for the breadcrumbs product URL

    Code:
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^page/([^/]+)/PROD/([^/]+)/([^/]+)$ /Merchant2/merchant.mvc?Store_code=$1&Screen=PROD&Product_code=$3 [QSA,L]
    So what would the rewrite need to be to get the long-style link without the store code directed to the short-style link with the store code?

    Many thanks!
    Leslie
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: X | Facebook | Pinterest
  • Dan - Glendale Designs
    Mega Mivite


    • Sep 2006
    • 2904

    #2
    Re: Another htaccess

    I am sure someone will give you an example, but if not, we offer custom .htaccess redirects/rewrites as a service.

    Comment

    • ILoveHostasaurus
      Mega Mivite










      • Mar 2006
      • 4998

      #3
      Re: Another htaccess

      If the store templates are set to output the store code, first thing you need to do is duplicate all of those short link rewrites to work the same way but without the store code. Next, modify the templates to not output the store code. Now you'll have short links that work whether they contain the store code or not. With that done, then you can redirect links that have the store code to those that don't. I'd also recommend using robots.txt to exclude bots from URL's starting with /Merchant2; that will get all those long URL's dropped. If they weren't excluded before, and had been in use at some time, you're probably being penalized for duplicate content and they'll never stop crawling them until you force them to.

      To redirect long to short; those rewrites must come above the ones that actually make the short links work:

      RewriteCond %{QUERY_STRING} Screen=PROD&Product_code=(.*)
      RewriteRule ^(.*)$ http://www.domain.com/page/PROD/$2 [R=301,L]
      David Hubbard
      CIO
      Miva
      [email protected]
      http://www.miva.com

      Comment

      • nottheusual1
        Mega Mivite


        • Jul 2008
        • 1124

        #4
        Re: Another htaccess

        We are having great luck with canonicals getting indexed (especially in categories so far) and that's all but killed the duplicate content and overly long URL issues we'd faced previously.

        Comment

        Working...
        X