.htaccess RewriteRule, check if RewriteRule target exists

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have another question regarding RewriteRule, and I'm hoping you guys
can help me out.

Here's what I have now:

RewriteCond % !-f
RewriteCond %/index\.php !-f
RewriteCond % !-d
    RewriteRule (.*)/(.*)/(.*) /$2/$3?ef=$1&$ [QSA,NC,L]

This effectively redirects something like "/business/faq/?answer=12"
to "/faq/index.php?ef=business&answer=12", which is exactly what I

But now, I want to add in another check to make sure that /$2/$3
exists; else, go to a default "/info/index.php?ef=$1&var2=$2&var3=$3".

How do I check if /$2/$3 exists, and if not, RewriteRule to another

Re: .htaccess RewriteRule, check if RewriteRule target exists

Quoted text here. Click to load it

Nevermind, I solved it myself. Unless you see a better way, this is
what worked:

### Redirect
RewriteCond % !-f
RewriteCond %/index\.php !-f
RewriteCond % !-d
    RewriteRule (.*)/(.*)/(.*) /$2/$3?ef=3D$1&$ [QSA,NC,L]

### Check if /$2/$3 exists, or give info/index.php
RewriteCond % !-f
RewriteCond %/index\.php !-f
RewriteCond % !-d
    RewriteRule ^(.*)$ /info/index.php?ef=3D$1&id=3D$2&%

Site Timeline