Exclude one folder in htaccess protected directory
Just create an .htaccess file in the subdirectory with the content:
1 2 3 |
Satisfy any |
[…]
Just create an .htaccess file in the subdirectory with the content:
1 2 3 |
Satisfy any |
[…]
Just put following code in your javascript file and It will pick all links globally from your website and will open them in a new tab. Don’t forget to replace url with your own website’s url.
1 2 3 4 5 6 7 8 9 |
$(document).ready(function(){ $('a[href*="website.com"] ').click(function(e) { e.preventDefault(); window.open(this.href, '_blank'); return false; }); }); |
[…]
Following funcion can be used to force to download remote files via curl:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
$file = 'https://googledrive.com/host/0B_3oJnpnNoF9UjlkVUwtWE5CY0U/city.jpg'; download($file); function download($url) { set_time_limit(0); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $r = curl_exec($ch); curl_close($ch); header('Expires: 0'); // no cache header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); header('Cache-Control: private', false); header('Content-Type: application/force-download'); header('Content-Disposition: attachment; filename="' . basename($url) . '"'); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . strlen($r)); // provide file size header('Connection: close'); echo $r; } |
[…]