Mobile app version of vmapp.org
Login or Join
Sarah324

: Disable serving specific files from web directory based on hostname used I have very specific problem and I don't even know if I am asking at right place and if it is even possible. I have

@Sarah324

Posted in: #Apache #Htaccess #Php

I have very specific problem and I don't even know if I am asking at right place and if it is even possible.

I have two domains, lets say domain1.com and domain2.com. Both domains share same root directory. So each file from domain1.com/file_url is accessible also as domain2.com/file_url
I am looking for a way, how to disable SOME of the files when requested with domain2.com. But not all of them, but just selected ones. Is it possible to set some "flag" or attribute for a file so Apache would recognize it and denied it when requested with domain2.com ?

Right now, the only solution which come to my mind is to create PHP script and use rewrite of each file in the directory and implement this "flag" checking inside this PHP file. But that would cost a lot of system resources, so I would thought if this could be done else ?

EDIT:

I have forgotten to specify that I am dealing with MANY files ( = thousands ), so I am not able to manually change config file for Apache. And those files are constantly growing since they are user-uploaded. Sorry I forgot to mention this important detail.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Sarah324

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme