Removing index.php using standard Rewrite rules not working for me

bleek

Joined: 2013-05-28
Posts: 1
Posted: Tue, 2013-05-28 11:46

Dear Gallery developers & users,

I've started using Gallery 3 since a couple of weeks and I must say I'm thrilled with it. It does exactly what I want and integrates with Lightroom, perfect!

But in tweaking the gallery to my liking I have stumbled upon a tiny hickup that I cannot seem to solve. I'm trying to remove the index.php from the url, like many others, by using the standard .htaccess file provided by Gallery 3. As you can guess from the title, it is not working for me.

Description of the issue:
- I'm running Linux (Raspbian on a Raspberry Pi) & Apache
- my 'gallery3' folder is called 'photos', so I've substituted that into the .htaccess file
- this is the code that is currently in sites-available config file (apache2.conf/httpd.conf extension) making sure the .htaccess file will be used by Apache:

<Directory /path/to/photos>
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order Allow,Deny
    Allow from All
</Directory>

- this is the code that is currently in the .htaccess file:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /photos
    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]
    RewriteRule ^index.php/(.*) $1 [QSA,R,L]
</IfModule>

- this works for the home page, if I go to mysite.com/photos then no index.php appears.
- But if I navigate to an album, by clicking (!), then the index.php reappears in the url: mysite.com/photos/index.php/album
- It doesn't work at all when I try to navigate to an (sub)album directly by typing into the addressbar: mysite.com/photos/album gives a 404 error. In Apache log it states "File not found" for such a request.

Options that I have tried already but gave no solution:
1- Commenting out the first and last line in .htaccess:

#<IfModule mod_rewrite.c>
#</IfModule>

2- Commenting out the Options +FollowSymLinks line, because I've already put that into my Apache config. Standalone and together with option 1.
3- Adding a trailing slash: /photos/ in the .htaccess file
4- Putting the block of Rewrite rules in my Apache conf, standalone and together with options 1 and 2.

Now I'm out of options and I unfortunately lack the knowledge to come up with more on my own. Can any of you help me out here?

Thanks in advance and best regards,
Joris.