From a5f1ef48498937621cd0ce4d0344650af2c580ec Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 24 Jun 2009 21:47:47 -0700 Subject: 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/ --- .htaccess | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to '.htaccess') 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 + +# 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. + + 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] + -- cgit v1.2.3 From 60442e170ba73641ce5545ca87de794b9fe98132 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 24 Jun 2009 21:50:35 -0700 Subject: Oops, remove my own custom RewriteBase. I can see that this is going to be a problem with this approach. --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.htaccess') diff --git a/.htaccess b/.htaccess index e55165ff..0a9d6367 100644 --- a/.htaccess +++ b/.htaccess @@ -22,7 +22,7 @@ # Then just use your Gallery 3 without the index.php in the url. RewriteEngine On - RewriteBase /~bharat/gallery3/ + RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L] -- cgit v1.2.3 From a19dba9416516fffaa53b0c1955d625c60d7e557 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 24 Jun 2009 22:01:08 -0700 Subject: Comment out the whole block; without proper configuration it breaks gallery3 if you don't specify index.php. --- .htaccess | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to '.htaccess') diff --git a/.htaccess b/.htaccess index 0a9d6367..3714aa64 100644 --- a/.htaccess +++ b/.htaccess @@ -9,22 +9,24 @@ # 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: +# uncomment the block below that starts with and ends with +# then properly configure the RewriteBase line in the +# block below. You just need to change RewriteBase line to match your +# Gallery 3 URL. 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 / +# 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. - - RewriteEngine On - RewriteBase / - 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] - +# +# +# RewriteEngine On +# RewriteBase / +# 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] +# -- cgit v1.2.3 From 766de009090cd1a49b6726e79bce7a69392491be Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 24 Jun 2009 22:25:38 -0700 Subject: Turn off magic_quotes_sybase and magic_quotes_runtime. Fixes ticket #394. --- .htaccess | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '.htaccess') diff --git a/.htaccess b/.htaccess index 3714aa64..79ba4be2 100644 --- a/.htaccess +++ b/.htaccess @@ -1,10 +1,12 @@ - php_value short_open_tag 1 - php_value magic_quotes_gpc 0 - php_value register_globals 0 - php_value session.auto_start 0 - php_value upload_max_filesize 20M - php_value post_max_size 100M + php_value short_open_tag 1 + php_value magic_quotes_gpc 0 + php_value magic_quotes_sybase 0 + php_value magic_quotes_runtime 0 + php_value register_globals 0 + php_value session.auto_start 0 + php_value upload_max_filesize 20M + php_value post_max_size 100M # You can use mod_rewrite to enable short urls in Gallery 3 (which -- cgit v1.2.3