diff options
Diffstat (limited to 'core/helpers/access.php')
-rw-r--r-- | core/helpers/access.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/helpers/access.php b/core/helpers/access.php index eda91d65..f2949528 100644 --- a/core/helpers/access.php +++ b/core/helpers/access.php @@ -468,9 +468,16 @@ class access_Core { */ private static function _create_htaccess_files($album) { foreach (array($album->file_path(), dirname($album->resize_path())) as $dir) { + $base_url = url::site("file"); $fp = fopen("$dir/.htaccess", "w+"); - fwrite($fp, "Order Deny,Allow\n"); - fwrite($fp, "Deny from All\n"); + fwrite($fp, "<IfModule mod_rewrite.c>\n"); + fwrite($fp, " RewriteEngine On\n"); + fwrite($fp, " RewriteRule (.*) $base_url/\$1 [L]\n"); + fwrite($fp, "</IfModule>\n"); + fwrite($fp, "<IfModule !mod_rewrite.c>\n"); + fwrite($fp, " Order Deny,Allow\n"); + fwrite($fp, " Deny from All\n"); + fwrite($fp, "</IfModule>\n"); fclose($fp); } } |