I have a Zend Framework 2 app and I wish to use .htaccess to rewrite some URLs. The .htaccess file is in my public folder. I have verified a simple rewrite rule which rewrites all testurl to test.php
RewriteRule ^testurl/?$ test.php [NC]
The test.php file is also in the public folder. I placed this rule above the Zend rule to map all URLs to index.php in .htaccess.
My question is how do i rewrite this to say the SearchController in the Index Module? I have tried various rewrite rules with different flags such as
RewriteRule ^testurl/?$ /index/search [NC]
and
RewriteRule ^testurl/?$ index/search [NC]
but i always get the 404 error The requested URL could not be matched by routing.
The reason i wish to use .htaccess is that i'll be using a regex in the rewrite rule to catch a few different URLs.
Many thanks