Ive been searching for days to see if this is possible but cant find it anywhere, if anyone knows a way to do this with the .htaccess file please let me know! I want to make it so if someone trys to get to a file on my server directly (they type in domain.com/thisfile.extension they are redirected to another file, say domain.com/otherfile.extension. BUT with that I also want to be able to include the real file in another file (domain.com/thisfile.extension). The problem is whenever I setup a redirect when it tries to include domain.com/thisfile.extension it will instead include domain.com/otherfile.extension. Is there any way to get what I want?
Yes RewriteEngine On RewriteRule ^folder1/(.+).zip http://fileReal.Com/$1.zip www.myweb.com/folder1/23.zip --->(redirected) http://fileReal.Com/23.zip
Thanks for the reply! It does close to what I want but still having a problem. Say the file is a .php file (just for simplicity) and I want to include it into another file, it instead includes the redirected file =/ Is there any way to make it include the true file but redirect anyone that tries to access the file directly.