Problem with redirecting or removing /index.php/ from url after upgrade to 3.0.4

AlternativePhot...
AlternativePhotography.com's picture

Joined: 2009-10-01
Posts: 150
Posted: Sat, 2012-08-04 10:11

Dear experts!
I've managed to upgrade to 3.0.4 without too much of a headache! :-)
The only problem i have is with removing the /index.php/
I would like it to say:
http://www.alternativephotography.com/gallery3/Olive-Dean
and not
http://www.alternativephotography.com/gallery3/index.php/Olive-Dean
as it did before the upgrade. I've played with the .htaccess files for an hours now without any luck. Please help me.

In my root htaccess file it says:

Quote:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^alternativephotography\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.alternativephotography\.com$
RewriteRule ^gallery3\/index\.php\/$ "http\:\/\/www\.alternativephotography\.com\/gallery3\/" [R=301,L]

RewriteCond %{HTTP_HOST} !^www\.alternativephotography\.com$ [NC]
RewriteRule ^(.*)$ http://www.alternativephotography.com/$1 [L,R=301]

in my /gallery/ folder the htaccess file it says

Quote:
# <IfModule mod_rewrite.c>
# Options +FollowSymLinks
# RewriteEngine On
# RewriteBase /gallery3
# RewriteCond %{HTTP_HOST} !^www\.alternativephotography\.com$ [NC]
# RewriteCond %{THE_REQUEST} /gallery3/(.*)$
# RewriteRule ^(.*) http://www.alternativephotography.com/gallery3/$1 [L,R]
# 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>

I've tried both with RewriteBase /gallery3 and RewriteBase /gallery3/ but no difference.

In my gallery/var folder i have another htaccess file (should it even be here?) that says:

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

I've tried both with RewriteBase /gallery3 and RewriteBase /gallery3/ but no difference here either.

Can anyone solve this puzzle? :-)
I'd really appreciate some help.

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2012-08-04 15:34

Staring at the beginning:
Did you uncomment the last section fo the gallery htaccess file (meaning take out the "#" sign before the lines)?
Make the RewriteBase /gallery3/

Report back.

 
AlternativePhot...
AlternativePhotography.com's picture

Joined: 2009-10-01
Posts: 150
Posted: Sat, 2012-08-04 15:51

Thanks for replying. No, it's exactlty like that. I've just done copy paste from the file. Should i be removing the #?
I've tried both /gallery3/ and /gallery3 but none of them works.

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2012-08-04 16:04
Quote:
Should i be removing the #?

Yes, you should.
The "#" sign tells the server to ignore the line; with the #, it's basically like the line's not even there.

 
AlternativePhot...
AlternativePhotography.com's picture

Joined: 2009-10-01
Posts: 150
Posted: Sat, 2012-08-04 17:50

It now looks like this:
htaccess file in the /gallery/ directory:

Quote:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /gallery3
RewriteCond %{HTTP_HOST} !^www\.alternativephotography\.com$ [NC]
RewriteCond %{THE_REQUEST} /gallery3/(.*)$
RewriteRule ^(.*) http://www.alternativephotography.com/gallery3/$1 [L,R]
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>

htaccess file in the /var/ directory:

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

Thank you! It now works! Just one final question while you're on the line... why do i need 3 htaccess files?
Thanks a lot!

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2012-08-04 18:01

I don't know why you have 3 htaccess files. Every site is different.

 
AlternativePhot...
AlternativePhotography.com's picture

Joined: 2009-10-01
Posts: 150
Posted: Sat, 2012-08-04 18:04

Ok! Just deleted the one form the /var/ directory and it still works. Thanks a lot for taking the time to help me.

 
darcey.lambert

Joined: 2012-08-06
Posts: 1
Posted: Mon, 2012-08-06 09:31

Try deleting the /var/ directory and check it will surely work without any errors.

 
AlternativePhot...
AlternativePhotography.com's picture

Joined: 2009-10-01
Posts: 150
Posted: Mon, 2012-08-06 10:05

Do you mean the htaccess file in the /var/ directory? That one is deleted, and it works. I can't delete the /var/ directory, that's where all the albums are, right?

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sun, 2012-08-12 21:40
Quote:
I can't delete the /var/ directory, that's where all the albums are, right?

RIGHT. If you delete the var directory, the Gallery is screwed and your photos are gone.