Announcement

Collapse
No announcement yet.

Handling URI redirect of .htaccess rewrites with wildcard character

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

    Handling URI redirect of .htaccess rewrites with wildcard character

    My .htaccess file has rewrite rules that contains wildcard characters.

    RewriteRule (.*) /mm5/merchant.mvc?Screen=PROD&Product_Code=%1&Store_Cod e=E [L]
    RewriteCond %{REQUEST_URI} ^/(.*)/(.*)/(.*)(.*) [NC]

    This was originally implemented to display the product's name in the URL and generated this format of link:
    /categorycode/productcode/Full+Product+Name+Is+Here.htm

    This naming format has become awkward over the years. While any version of the product's name successfully redirects thanks to the wildcard character, there have ended up being several versions of links that exist for each product and it is impossible to account for with individual redirects. (product+name+here.htm, Product+Name.htm, productname.htm, PRODUCT.htm)

    I am updating the site and want to use URI Management to handle 301 redirects instead of an .htaccess file. Is there a way to handle the wildcard product name when creating a 301 redirect in the URI Product Template language? Basically, how do I replicate the wildcard character so that all variations of the product name redirect to the canonical link version?

    This???
    /<mvt:do name="l.return" file="g.Module_Library_DB" value="Category_Load_ID( l.settings:product:cancat_id, l.category )" /><mvt:eval expr="l.category:code" />/&mvt:product:code;/*.htm
    Where * is the product name.


    Thank-you,
    Shannon

    #2
    There is no concept of a wildcard with URI management. You would need to generate all variations of the product name and then import them as individual URIs that redirect back to the canonical.

    If you didn't want to do that you could implement the redirect at the .htacces level.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      We have performed a number of URI Management transitions with 301 redirects for clients/builds with particularly crazy url structures used on their previous stores. Please feel free to reach out to us if you need assistance with these tasks.

      Comment


        #4
        Thanks Brennan. That's what I was afraid of as far as the wildcard character goes. I'd need help to implement any changes at the .htacceess level when our site goes live. Dan, I have called your office and am sending over more details now to get a quote.

        Thanks,
        Shannon

        Comment


          #5
          I didn't notice any qualifiers. If memory serves, "at this time" was used in threads when discussing URI and wildcards in the past, but I don't recall if it was from Miva. Is this something that that might pop up as a feature in a future Miva update?

          Originally posted by Brennan View Post
          There is no concept of a wildcard with URI management. You would need to generate all variations of the product name and then import them as individual URIs that redirect back to the canonical.

          If you didn't want to do that you could implement the redirect at the .htacces level.
          Charlie Morrison
          www.MCRmedical.com

          Comment


            #6
            Originally posted by Brennan View Post
            There is no concept of a wildcard with URI management. You would need to generate all variations of the product name and then import them as individual URIs that redirect back to the canonical.

            If you didn't want to do that you could implement the redirect at the .htacces level.
            We have a similar url structure as the op but not having any luck getting the htaccess file to play nice once the Miva URI Management data is present after generating the old canonicals in the URI Management. An old url actually directs to the correct category (you can tell by the subcats in the left nav) but it returns the Requested Item Not Available page instead of the product or category specified. Its like its trying and almost there but just not getting it.

            Comment

            Working...
            X