The path to all the albums has changed

geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 14:22

Our Bandit club gallery and albums has run flawlessly for years, but the spam was building up in the comments. I used the configuration wizard to turn off all comments and saved the config.

Now all the albums have different path names and they can't be found by the links on my main website.

An example path used to be: http://bandittransamclub.com/gallery/BrettCampbell

Now that album path is: http://bandittransamclub.com/gallery/view_album.php?set_albumName=BrettCampbell

For some odd reason this has been inserted into every albums path: view_album.php?set_albumName=

I'm running Gallery 1.5.10

Any help is appreciated.

George Holt
Director, Bandit Trans Am Club

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-09-03 15:39

I'd have to install G1 again and dig around to fig our what to change, but it looks like URL Rewrite got disabled. I don't know if it's because your .htaccess got deleted I don't remember if G1 only used settings in .htaccess or needed some switch in config.php

Oh, just remembered I still have 1 G1 install alive that I need to kill off, but I took a look. Here's what's in my .htaccess:

# BEGIN Gallery section
# (Automatically generated.  Do not edit this section)
# Note: still under development, so format may change.
# If you edit this file, make a backup before runnng the Config. Wizard.


Options -Indexes +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /gallery/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/([0-9]+)$      /gallery/view_photo.php?set_albumName=$1&index=$2       [QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/([A-Za-z_0-9\-]+)$     /gallery/view_photo.php?set_albumName=$1&id=$2  [QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/$      /gallery/$1     [R]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)$       /gallery/view_album.php?set_albumName=$1        [QSA]
</IfModule>
# END Gallery section.  Add User changes below this line

And it looks like there's a setting in config.php to turn rewrite on or off. Make sure it's set to 1:

$gallery->app->feature["rewrite"] = 1;
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 17:02

The rewrite was set to 0 so I set it to 1. Now when you click on an album, the correct path appears in the browser window, but it can't find the page.

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 17:05

Where is the .htaccess?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-09-03 17:11

It should be at the root of your gallery folder. Looks like someone deleted that or your host removed it....

Or you may not be seeing it depending on how your ftp client is configured. Check your ftp program's help file to make sure you're able to view hidden files.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 17:32

I went into Gallery Configuration Wizard: Step 1, and it says the following: "Gallery could not test if your webserver is obeying the 'php_value' lines in your .htaccess as the (original) .htaccess file in your setup folder is missing."

I checked show hidden files in my ftp program, (Front Page), and .htaccess is not there.

How do I put it back?

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 17:40

Well, I just put it back to 0 and the albums are back, but with the wrong address again. AT least they are back. How do you put the .htaccess back in?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-09-03 17:48

ugh, front page (what a flaming pile) opinions aside.

Create a text file call it htaccess.txt

Copy these lines into it:

# BEGIN Gallery section
# (Automatically generated.  Do not edit this section)
# Note: still under development, so format may change.
# If you edit this file, make a backup before runnng the Config. Wizard.


Options -Indexes +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /gallery/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/([0-9]+)$      /gallery/view_photo.php?set_albumName=$1&index=$2       [QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/([A-Za-z_0-9\-]+)$     /gallery/view_photo.php?set_albumName=$1&id=$2  [QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/$      /gallery/$1     [R]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)$       /gallery/view_album.php?set_albumName=$1        [QSA]
</IfModule>
# END Gallery section.  Add User changes below this line

Upload that to your site, then rename htaccess.txt to .htaccess

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 17:54

Thanks, I'll try it now.

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 18:01

It won't let me put the . in front of htaccess

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-09-03 18:10

Did you upload that to the webserver and try to rename it there? Windows won't let you have a file with a period in the front of it. Well it will if you download it, but you can't rename a file with that or save a file that way. Take that back, looks like Win7 (and probably Vista) do now, but Winxp and older won't.

If it's on the webserver and it won't let you rename that, you'll need to talk to your host.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 18:11

Thank you.

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 18:29

Your a bloody genius aren't you. How come you don't work for NASA?

Thanks, it works great now.
Have a great Labor Day weekend, I know I will now.

George

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-09-03 18:34

Far from anything resembling genius, just using Gallery a lot :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
geoholt3
geoholt3's picture

Joined: 2006-01-17
Posts: 47
Posted: Fri, 2010-09-03 19:59

Well, you da man!!! :)