I have the following .htaccess rule:
RewriteEngine on
RewriteRule ^(.*) http://www.server2.com/index.php?action=$1
I need to add another redirect, which should work this way:
RewriteRule ^app/(.*) index.php [L]
so request is not passed to server2, but served in place.
As I understand, if I add this line, .htaccess is called second time and I am redirected to server2.com/index.php.
I hope, there is some sort of switch that I can use to prevent second mod_rewrite call or should I use RewriteCond instead (for example as here)?
Exclude the pattern of the second rule in your first rule: