.htaccess: how to restrict access to specific images from my mobile site -


for mobile site want restrict access of images "lady bug.gif" "bluemoon.gif" etc. these images won't shown in http://m.mysite.org faster , less clutter mobile experience. how can this?

not working example:

 rewriteengine on <files bluemoon.gif> order allow,deny deny </files> 

i think better off internally rewriting small 1px image, rather blocking access. if block access (404, 403, etc) end errors in front end.

options +followsymlinks rewriteengine on rewritecond %{http_host} =m.mysite.org rewriterule (lady\sbug|bluemoon)\.gif$ /images/mobile-placeholder.gif [l] 

note if have spaces in filenames need replace these \s in rewriterule pattern (a regular expression) - above.


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -