htaccess is it possible...?

Discussion in 'Apache' started by trigoon, Jan 30, 2008.

  1. #1
    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?
     
    trigoon, Jan 30, 2008 IP
  2. themasterinc

    themasterinc Banned

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2

    Yes :)


    RewriteEngine On
    RewriteRule ^folder1/(.+).zip http://fileReal.Com/$1.zip



    www.myweb.com/folder1/23.zip --->(redirected) http://fileReal.Com/23.zip





    :) :) :)
     
    themasterinc, Jan 30, 2008 IP
  3. trigoon

    trigoon Peon

    Messages:
    171
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.
     
    trigoon, Jan 30, 2008 IP