So for security reasons, I want to disallow http://www.domain.com/directory/
but allow that physical directory only through http://subdomain.domain.com/directory/
The simple way would be to just move the directory, but I can't do it because it breaks the application, so how would I do this with .htaccess?
I've temporarily blocked it using:
RedirectMatch 301 ^/directory/$ http://www.domain.com/
But of course that redirects the subdirectory in either case, so what I'd think is I could just put:
RedirectMatch 301 ^http://www.domain.com/directory/$ http://www.domain.com/
or something similar but it doesn't work... suggestions?