I have a WordPress deployment and I want to ignore all external accesses to resources that exists (i.e. files and directories) but I want to accept all internal redirects. The idea is to not reveal to external users that /wp* exists. I know that I will have to rename wp-content for this to work (as well as tweak some things in wp-config.php, but the bottom line is:
How do I configure my .htaccess file to only accept internal redirects and to ignore all other requests?
I think there’s %{ENV_VAR} somewhere that would let me create a RewriteCond but I couldn’t find it in the apache docs.
I tried both IVA and hakre’s suggested methods. They didn’t work for what I was trying to do. The way that I got this to work was similar to what hakre suggested but instead of defining my own variable I use one that is already defined:
%{ENV:REDIRECT_STATUS}. Do something similar to this: