index.php in the address

peshko

Joined: 2010-11-22
Posts: 81
Posted: Mon, 2012-04-30 11:40

Hi. Have a quick question. I run Gallery 3.0.3. If I go to my gallery main page everything works great. But every time I go to an album the url adds/contains index.php and if I want to go directly to the album, I have to have the index.php in the address. For example:

the main gallery page is http://gallery.peshkospics.com and I have an album there named vacation-pictures. If I want to go directly to that album, I have to put http://gallery.peshkospics.com/index.php/vacation-pictures. My goal is to have http://gallery.peshkospics.com/vacation-pictures.

What am I missing here?

Thanks a lot!

/Peshko

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 606
Posted: Mon, 2012-04-30 13:17

Take a look at the .htaccess file in the gallery root folder, there is a section for removing the index.php from the URLs via mod_rewrite. If you need further clarification, let us know.

# You can use the mod_rewrite Apache module to get rid of the
# "index.php" from your Gallery 3 urls.  Uncomment the block below
# inside the <IfModule> ... </IfModule> lines and then edit the
# RewriteBase line to match your Gallery 3 URL.
#
# Here are some RewriteBase values:
#   Gallery 3 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.
#
# NOTE: future upgrades of Gallery 3 will overwrite this file!  If you
# want these changes to be persistent, talk to your system admin about
# putting this block into your Apache config files.
#
# <IfModule mod_rewrite.c>
#   Options +FollowSymLinks
#   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]
#   RewriteRule ^index.php/(.*) $1 [QSA,R,L]
# </IfModule>

Uncomment (remove the '#'s) from the last 10 lines above to look like below:

# You can use the mod_rewrite Apache module to get rid of the
# "index.php" from your Gallery 3 urls.  Uncomment the block below
# inside the <IfModule> ... </IfModule> lines and then edit the
# RewriteBase line to match your Gallery 3 URL.
#
# Here are some RewriteBase values:
#   Gallery 3 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.
#
# NOTE: future upgrades of Gallery 3 will overwrite this file!  If you
# want these changes to be persistent, talk to your system admin about
# putting this block into your Apache config files.
#
 <IfModule mod_rewrite.c>
   Options +FollowSymLinks
   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]
   RewriteRule ^index.php/(.*) $1 [QSA,R,L]
 </IfModule>
 
chess69

Joined: 2012-05-19
Posts: 16
Posted: Tue, 2012-05-29 14:26

I tried this and yes the links go back to the main site but the entire gallery section just leads to a page 500 - internal error???

even if i type in the links directly they still come back as if no such page exists??

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 606
Posted: Tue, 2012-05-29 15:42

This indicates that you made an error in the .htaccess file. Please revert to a good copy and try again.