From 3e219aab6ba88738832627ac39a3b3249f0ce2c3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 16 Dec 2008 08:17:00 +0000 Subject: Change htaccess rules to use mod_rewrite --- core/helpers/access.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'core/helpers/access.php') 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, "\n"); + fwrite($fp, " RewriteEngine On\n"); + fwrite($fp, " RewriteRule (.*) $base_url/\$1 [L]\n"); + fwrite($fp, "\n"); + fwrite($fp, "\n"); + fwrite($fp, " Order Deny,Allow\n"); + fwrite($fp, " Deny from All\n"); + fwrite($fp, "\n"); fclose($fp); } } -- cgit v1.2.3