Announcement

Collapse
No announcement yet.

.htaccess issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    .htaccess issue

    I have product versions of every category existent and I want to redirect from the product page to the static version of the category page (We have Merchant Optimizer).

    I have tried several things but none work.

    Redirect ^/Merchant2/merchant.mvc?Screen=PROD&Store_Code=THDC&Product_C ode=bellora-classic-blue-linen-bedding http://www.home-decorating-co.com/be...n-bedding.html


    Redirect redirect ^/Merchant2/merchant.mvc?Screen=PROD&Store_Code=THDC&Product_C ode=bellora-classic-blue-linen-bedding http://www.home-decorating-co.com/be...n-bedding.html


    redirect http://www.home-decorating-co.com/Me...-linen-bedding http://www.home-decorating-co.com/be...n-bedding.html

    Redirect http://www.home-decorating-co.com/Me...-linen-bedding http://www.home-decorating-co.com/be...n-bedding.html

    redirect /Merchant2/merchant.mvc?Screen=PROD&Store_Code=THDC&Product_C ode=bellora-classic-blue-linen-bedding http://www.home-decorating-co.com/be...n-bedding.html

    RedirectMatch 301 ^/Merchant2/merchant.mvc?Screen=PROD&Store_Code=THDC&Product_C ode=bellora-classic-blue-linen-bedding http://www.home-decorating-co.com/be...n-bedding.html

    RewriteCond %{QUERY_STRING} ^Screen=PROD&Product_Code=bellora-classic-blue-linen-bedding$
    RewriteRule ^Merchant2/merchant.mvc$ http://www.home-decorating-co.com/bellora-classic-blue-linen-bedding.html? [R=301,L]

    I created an .htaccess file for this and uploaded it into httpdocs

    What am I missing?

    #2
    Re: .htaccess issue

    The first ones get split for some reason when post the question but they were typed properly on the .htaccess file.

    Comment


      #3
      Re: .htaccess issue

      The Redirect statement does not look at query strings, so those will not work. You can only use full rewrites like you did at the end with the RewriteCond statement; that one's not working because your rule isn't correct since those do match query strings but you've left it off. Change that to:

      RewriteRule ^(.*)$ http://www.home-decorating-co.com/be...-bedding.html?

      since it doesn't matter what you're replacing.
      David Hubbard
      CIO
      Miva
      [email protected]
      http://www.miva.com

      Comment


        #4
        Re: .htaccess issue

        So I will have to use these two lines?

        RewriteCond %{QUERY_STRING} ^Screen=PROD&Product_Code=bellora-classic-blue-linen-bedding$
        RewriteRule ^(.*)$ http://www.home-decorating-co.com/be...-bedding.html?

        Comment


          #5
          Re: .htaccess issue

          That's correct, but when using Optimizer you should be able to get away with just a few generic rewrites to catch all of the pages:


          RewriteCond %{QUERY_STRING} !pm_static_is_running=yes [NC]
          RewriteCond %{QUERY_STRING} Screen=PROD [NC]
          RewriteCond %{QUERY_STRING} Product_Code=(.*?)& [NC]
          RewriteRule ^(.*) http://www.domain.com/%1.html? [R=301,L]

          RewriteCond %{QUERY_STRING} !pm_static_is_running=yes [NC]
          RewriteCond %{QUERY_STRING} Screen=PROD [NC]
          RewriteCond %{QUERY_STRING} Product_Code=(.*)$ [NC]
          RewriteRule ^(.*) http://www.domain.com/%1.html? [R=301,L]

          RewriteCond %{QUERY_STRING} !pm_static_is_running=yes [NC]
          RewriteCond %{QUERY_STRING} Screen=CTGY [NC]
          RewriteCond %{QUERY_STRING} Category_Code=(.*)& [NC]
          RewriteRule ^(.*) http://www.domain.com/%1.html? [R=301,L]

          RewriteCond %{QUERY_STRING} !pm_static_is_running=yes [NC]
          RewriteCond %{QUERY_STRING} Screen=CTGY [NC]
          RewriteCond %{QUERY_STRING} Category_Code=(.*)$ [NC]
          RewriteRule ^(.*) http://www.domain.com/%1.html? [R=301,L]
          David Hubbard
          CIO
          Miva
          [email protected]
          http://www.miva.com

          Comment


            #6
            Re: .htaccess issue

            The problem is I don't mean to redirect every single dynamic product page to static, there are only a few that I am intending to.These products I am trying to redirect have the exact code as the category codes that is why I can't use the static versions of them because it would overwrite their static pages

            Comment


              #7
              Re: .htaccess issue

              To be more specific, the reason why I am trying to do all this is because I am trying to implement a search with search manager.Originally the idea was to do it on a category level the problem was that the search wouldn't be so efficient since in our store (Bedding Company) our categories equal collections which are subdivided depending on the type of items such as comforters, comforter sets, bedskirts, etc which are the subcategories.If a customer searches for Brand+Collection Name+Item Type he wont find it because the category name only contains: Brand+Collection.Now the idea was to use keywords but we have all the possible fields available on categories used for other purposes such as SEO.Considering that we decided to use dummy products that link to the corresponding category hence the reason of trying to use the redirects.The reason why we use product codes that are identical to their category version is they actually exist already on our store for a complete different purpose:http://www.home-decorating-co.com/pr...l_bedding.html

              The Category page shown is actually displaying products that contain an additional field which contains the corresponding category code so instead of using the tokens : %prodnameL% and %prodthumbL%, the hyperlinks are built this way:

              <a href="http://www.home-decorating-co.com/Merchant2/merchant.mvc?Screen=CTGY&amp;Store_Code=THDC&amp;C ategory_Code=%module|DEN_PRODFIELDS|PRODCATCODE|%" >%prodthumb%</a>

              <a class="special" href="http://www.home-decorating-co.com/Merchant2/merchant.mvc?Screen=CTGY&amp;Store_Code=THDC&amp;C ategory_Code=%module|DEN_PRODFIELDS|PRODCATCODE|%" >
              <font color="#686964">%prodname%</font></a>

              That way they link to the corresponding category.

              The reason why we had to do this is because we had to display the same categories in different places and instead of replicating the same categories over and over it was more convenient to have dummy products since these can be assigned to more than one category unlike categories.

              I know my explanation is very long but I am just trying to convey why I can't merchant optimize products.

              Thank you

              Comment


                #8
                Hi, New here and I am also trying to redirect comforter sets http://www.elanlinen.com.au/comforter-sets and it is giving errors, could you please help!
                Shop online comforter sets in Australia. All sizes king, queen, double, twin, and all designs of top brands. Best shopping comforter sets deals, shipping Australia wide.

                Comment

                Working...
                X