I've been moving some rewrites from .htaccess to our vhost_ssl.conf file. Most are working fine, except ones that utilize our ecommerce platform.

We use Miva Merchant as our ecommerce platform, which uses its own handler for .mvc files. When I do a rewrite to a .mvc file, Apache (or nginx or something) complains...

AddType application/x-miva-compiled .mvc
Action application/x-miva-compiled /cgi-bin/mivavm

RewriteCond %{REQUEST_URI} ^/t3
RewriteCond %{REQUEST_URI} (/$|\.)
RewriteRule (.*) /mm5/merchant.mvc

Result in browser when I visit example.com/t3/:

Unable to execute 't3/': No such file or directory

Rewrites to "normal" files like .htm or .php work just fine. I have a limited understanding of these sorts of things, but it seems to me that the server doesn't understand what to do with the .mvc destination file..? Any suggestions are appreciated!

EDIT: Just wanted to point out that direct visits to .mvc files work fine, so the server does understand what to do. It seems like something about the rewrite confuses things.


This turned out to be that my rewrites needed the PT (passthrough) flag added, for example:

RewriteCond %{REQUEST_URI} ^/t3
RewriteCond %{REQUEST_URI} (/$|\.)
RewriteRule (.*) /mm5/merchant.mvc [PT]

There was a ScriptAlias on our cgi-bin directory, which made the the PT flag necessary. The PT flag is implied in the .htaccess file but not in vhost. See https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_pt for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.