edit existing (in your www or public_html folder) or Create a new text file and save it as .htaccess with the following:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yourdomain/ [NC]
RewriteRule images.(php)$ http://i.imgur.com/qX4w7.gif [L]
replace yourdomain with your own domain and http://i.imgur.com/qX4w7.gif to whatever page you want to show to prevented requests.
Worked very nicely. I tried it from another domain and it showed no images. Thank you SABI sooo much for your time and help.
I want to ask you a different question. My 20 pages have parts with identical html code lines, is it possible to use one centralized file where I save those parts, then all the pages extract those parts from it? Sort of a template but only for specific parts of html not all the page content?.. because right now, every time I want to change a line of code, I have to do it repeatedly in each of the 20 pages..
Yes you can do that in PHP using include() directive/function; for this you will need to convert those pages to PHP (or simly rename .html to .php) then you can import external file where ever you want to.
Ooops.. sorry about that ZABI
So if say there are 5 repeated lines from line 3 to line 7, then 2 repeated lines from line 10 to 11, should I create separate common.html files for each group of lines, and type the include command twice in place of the 2 sets of lines? or use one common.html file for all the parts? and if so, how do I guide the pages to each part in the common file?
An example please?
now you just have to use this php file in place of your external js file
no need for updating or writing to files or any thing else, it will automatically generate array when accessed
PHP Code:
<?php $source='http://www.spinneys.com/sites/Egypt/News.aspx?pageid=54'; @fopen($source, 'r') or die('Error accessing URL');
The script is no longer pulling any images.
The script was pulling images from their urls listed in a webpage:
spinneys.com/sites/Egypt/News.aspx?pageid=54
But now there is no webpage, and I have to pull the images from the directory where they are saved:
spinneys.com/Library/Images/
Bookmarks