Forum Moderators: phranque
I don't think I can put if statements in the .htaccess file
BUT if the directory does not exist, then I want to direct it
to: example.com/info.php?pg=mypage
the -d and -f lookups are decidedly a last resort. (In htaccess, it probably means the server has to look up the same thing twice. In config it may remember "Oh, right, I've already found this".)
..."Oh, right, I've already found this"
when the directives are interpreted
I have a situation where I want to direct this
url : mypage.example.com
to: example.com/mypage/
BUT if the directory does not exist, then I want to direct it
to: example.com/info.php?pg=mypage
if someone requests http://example.com/mypage.html * and the directory /mypage/ doesn't exist within the document root directory, you want the request internally rewritten to /info.php?pg=mypage
If this interpretation is correct, then it almost certainly does make more sense to simply rewrite everyone this way. Then the php page can do the lookup and, if appropriate, issue a redirect.