summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-24 21:47:47 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-24 21:47:47 -0700
commita5f1ef48498937621cd0ce4d0344650af2c580ec (patch)
treefdc3b2fba8e66b49e923099f4162231061bed6be
parent7347d1e50db102142f1c82bfeb70734475f58195 (diff)
Add support for mod_rewrite in the .htaccess file. There are now
instructions for how to tweak RewriteBase correctly. Once that's done, index.php will automagically disappear. \o/
-rw-r--r--.htaccess22
-rw-r--r--application/config/config.php2
2 files changed, 23 insertions, 1 deletions
diff --git a/.htaccess b/.htaccess
index 190ff745..e55165ff 100644
--- a/.htaccess
+++ b/.htaccess
@@ -6,3 +6,25 @@
php_value upload_max_filesize 20M
php_value post_max_size 100M
</IfModule>
+
+# You can use mod_rewrite to enable short urls in Gallery 3 (which
+# gets rid of the "index.php" from your urls). To do this, you must
+# properly configure the RewriteBase line in the block below. You
+# just need to change RewriteBase line to match your installation.
+# Here are some examples:
+#
+# Gallery3 URL RewriteBase line
+# ============= ====================
+# http://example.com/gallery3 RewriteBase /gallery3
+# http://example.com/~bob/photos RewriteBase /~bob/photos
+# http://gallery3.example.com/ RewriteBase /
+#
+# Then just use your Gallery 3 without the index.php in the url.
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteBase /~bharat/gallery3/
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
+ RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
+</IfModule>
diff --git a/application/config/config.php b/application/config/config.php
index 2d66d1c0..e88958ed 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -54,7 +54,7 @@ $config["site_protocol"] = "";
*
* This can be removed by using URL rewriting.
*/
-$config["index_page"] = "index.php";
+$config["index_page"] = isset($_GET["kohana_uri"]) ? "" : "index.php";
/**
* Fake file extension that will be added to all generated URLs. Example: .html