Fixing Spaces in URL Caused by Product Codes with Spaces

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











    • Aug 2008
    • 9295

    #1

    Fixing Spaces in URL Caused by Product Codes with Spaces

    Store has almost 500 product codes with spaces in them, and has been stuck using the Legacy SEO Settings after we discovered where the plus marks in the links were coming from.

    The Legacy SEO Settings use this:
    Code:
    ### Begin - Inserted by Miva Merchant
    
    DirectoryIndex /mm5/merchant.mvc
    
    RewriteEngine On
    
    RewriteRule ^mm5/admin.mvc - [QSA,L]
    
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^product/([^/.]+)\.html$ /mm5/merchant.mvc?Screen=PROD&Product_code=$1 [QSA,L]
    
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^category/([^/.]+)\.html$ /mm5/merchant.mvc?Screen=CTGY&Category_code=$1 [QSA,L]
    
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^([^/]+)/([^/.]+)\.html$ /mm5/merchant.mvc?Screen=PROD&Category_code=$1&Product_ code=$2 [QSA,L]
    
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^([^/.]+)\.html$ /mm5/merchant.mvc?Screen=$1 [QSA,L]
    
    ### End - Inserted by Miva Merchant


    The URI Management will update the .htaccess file to this:

    Code:
    ### Begin - Miva Merchant URI Management: Direct all non-file URIs to Miva Merchant
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteCond %{REQUEST_URI} !^/mm5/.*$
    RewriteCond %{REQUEST_URI} !(gif|jpg|jpeg|jpe|xbm|png)$
    RewriteRule ^(.*)$ /mm5/uri.mvc? [QSA,L]
    ### End - Miva Merchant URI Management
    When the .htaccess file is updated, the plus sign disappears from the links, and they break.

    I had asked about this in the past, and I'm wondering if I can do an import for the old links needing to be redirected using the /some+old+product+code.html Ron had suggested.

    I'm sure someone will share the reason that Dots, Slashes and Spaces are not allowed in Miva Product Codes. We are a reseller and carry products from 100+ different manufacturers and many use Dots, Slashes and Spaces in their part numbers. When we have to add those we have chosen to convert all the Dots, Slashes and Spaces to


    The thread seemed to die out there, and the store owner wasn't really concerned about it. In hindsight, I should have checked the "use strict validation for codes" checkbox at the time. It would have at least reminded the storeowner of the issue.
    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
Working...
X