24/7 Support: 800.608.6482

Get Started

Reference Guide

.htaccess

The .htaccess file is a web server configuration file. It lives on your server machine and can be used for quite a few different things, including your store URLs. Miva Merchant occasionally needs to write to your .htaccess file. Historically, however, people would also manually edit the .htaccess file, and that's where the trouble started. Sometimes, the Miva Merchant software would over-write a change that you had manually made to the file. Sometimes people would edit or delete changes that the Miva Merchant software had made, and in either case, your store wouldn't behave as expected.

To make life a little easier, Miva Merchant added the .htaccess tab in Version 9.0004. This tab is basically an interface to your store's .htaccess file for managing URLs. One of the changes in Version 9.0004 is that Miva Merchant now writes URL information to clearly labeled "blocks" in the .htaccess file.

You can continue to manually edit your .htaccess file, as long as you don't make changes within the Miva Merchant blocks.

If you set your Link Source to:

  • Long URLs: Miva Merchant won't write anything to your .htaccess file.
  • Legacy SEO Short Links: The Miva Merchant code block looks like this:

    ### 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

  • URI Management: The Miva Merchant code block looks like this:
  • ### Begin - Miva Merchant URI Management: Direct all non-file URIs to Miva Merchant

    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-s

    RewriteCond %{REQUEST_URI} !^/mm5/.*$

    RewriteRule ^(.*)$ /mm5/uri.mvc? [QSA,L]

    ### End - Miva Merchant URI Management

    Please also see:

  • Miva Merchant URLs - A Brief History
  • Link Source
  • Changing Your Link Source

Update Button / Delete Button

In most cases you use the Update and Delete buttons when you change your link source. See Changing Your Link Source.

  • The Update button deletes the contents of a Miva Merchant .htaccess block and re-writes it.
  • The Delete button deletes the contents of a Miva Merchant .htaccess block, including the Miva Merchant block delimiters.

Recall Button

In Version 9.0004, Miva Merchant added a kind of backup and restore function for your .htaccess file. Every time you click the Update or Delete buttons in the .htaccess tab, Miva Merchant:

  1. Makes a copy of the current .htaccess file and timestamps it.
  2. Makes your changes to the current htaccess file.

To Restore a Previous Copy of Your .htaccess File

URI Recall

  1. Go to Menu> URI Management > .htaccess tab.
  2. In the Recall panel, click "Select One".
  3. Select a file from the list of backed up .htaccess files.
  4. Click Recall.

Looking for Developer Docs?

We have a whole section for that, including: Developer Training Series, Template Language docs, Module Development tutorials and much, much more.

Head to the Developer Section

Miva believes that all online businesses should have access to a scalable ecommerce platform that can meet their unique business requirements. Miva offers PCI compliant ecommerce, hosting, and custom website design and development solutions. Miva customers have processed over $100 billion in online sales since 1997.

Copyright © 2016 Miva, Inc - All Rights Reserved   Privacy Policy | Store Policy

Links
Contact Us
Receive Tips & Updates

Copyright © 2017 Miva, Inc - All Rights Reserved

Back To The Top