i have a web site and i have an a sub folder there where there is files which i like to be embedded on my index page. But i want to privent users to view that sub folder directly.
So. i have http://mysite.com/index.php where there is an iframe:
and i have a subfolder opt2 with index.php with an iframe:
<iframe src="http://mysite.com/opt2/" id="shopIframe" name="shopIframe" onload="alert('a');" frameborder="0" height="90%" width="100%" scrolling="auto"></iframe>
i have an .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_REFERER} http://mysite.com/opt2/ [NC]
RewriteRule /*$ http://mysite.com/index.php [R=302,L]
is that possible with .htacces?
The referrer would be
http://mysite.com/index.php, nothttp://mysite.com/opt2/.Also some firewall software, proxies etc. remove the referrer header, so you’d better first check if referer is available at all.
addition