I have a file called test.php on www.example.com/test.php. Now I would like that if you VISIT www.example.com/directory/test.php you get shown the content of test.php.
So I don’t want to make a 301 redirect. But I do want to people to visit www.example.com/directory/test.php. Is the only way to do this to create a new folder in my FTP called directory and upload it there?
You don’t have to create a new directory named ‘directory’, you can do
RewriteRule ^directory/test\.php$ http://example.com/test.php [P]instead.