Is there a way to determine whether the file has been requested by CSS? Assuming that everything goes through a master file index.php.
Is there a way to determine whether the file has been requested by CSS?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have managed to get this done, a pretty hacky way, but possible.
Basicly, the router (a PHP one) works with masks, and some files can only be accessed if the mask has been set.
When loading CSS file, I set the required mask, when loading the corresponding images I check for the mask and if it matches the required one, I load display the image. So, when looking at the rendered page it works, but when accessing the file directly, it does not.
Mask is a SESSION variable for now, that gets unset after file routing.
I will get a clean working example and update this answer with it sometime in future.