I will vote for Apache.
If you do this at the Apache level (in the .htaccess file, or better yet, in the Apache configuration), then if you have HTML files, the only way I can think of this, is JavaScript; this can be easily removed (e.g. disable javascript).
This also applies to other types of files, such as PDF files, Word documents, MP3 files, etc. It can easily be redirected to a page containing the message "not available for mobile."
Another thing I can think of is a css file if they are different (standard version and mobile version).
Lauren smith
source share