Announcement

Collapse
No announcement yet.

htaccess rewrite rules help

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

    htaccess rewrite rules help

    I'm trying to add some redirect rules in htaccess for a few different category and product url formats, but the ones I've tried so far aren't working.

    The url that I'm trying to get to redirect is formatted like this -

    https://www.website.com/mm5/merchant...e=categoryCode

    I've just added the following but I dont see them working. I've checked in an incognito browser as well -

    RewriteCond %{QUERY_STRING} ^Screen=CTGY&Category_code=(.*)$
    RewriteRule ^(.*)$ /c/%1.html? [R=301,L]

    RewriteCond %{QUERY_STRING} ^/mm5/merchant.mvc?Screen=CTGY&Category_code=(.*)$
    RewriteRule ^(.*)$ /c/%1.html? [R=301,L]

    I have similar rewrite rules that I need for product urls, and I'm curious how I redirect to those, the products have keyword based uri's created in uri management so they dont use a standard format like using the product code in the url like /p/productCode.html
    Last edited by heatherwebdev; 01-03-24, 06:55 AM.

    #2
    heatherwebdev Can you confirm that no other redirects are happening before your redirects?

    Maybe try to add your redirects at the very top of the .htaccess file and see if they work.
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment


      #3
      These rewrite rules are at the top of my htaccess. I do have other category redirects below them, but not for the long form url like the ones I'm trying to redirect

      Comment

      Working...
      X