Hi all,
http://www.generalmagic.org has been running for a while (with sub-albums now) but it's the first time I tackle the issue of mod_rewrite/.htaccess.
I have turned on mod_rewrite in the zp-config.php file and modified my .htaccess (in /var/www/gallery with:
RewriteBase /gallery
I have switched to the testing theme to eliminate any issue that might be theme related.
http://www.generalmagic.org/gallery/ works but clicking on any album doesn't.
Where should I look first ?
Comments
What version are you running. If not 1.8.0.2, then you should upgrade. Modrewrite and subalbums didn't work "perfectly" before version 1.0.7.
If you are on 1.8.0.2, then let us know, and we can help you further from there.
Try that, and let us know.
cp index.php /var/www/gallery
cp -r zen/* /var/www/gallery/zen
Note that the version on the admin tool still says 1.0.8, I am not sure that's right.
The problem remains. Don't know if it's subalbums related as clicking on a main album results in the error.
http://www.generalmagic.org/gallery/ -> works
http://www.generalmagic.org/gallery/page/2/ -> does not work
http://www.generalmagic.org/gallery/Portfolio 2005/ -> has a space, doesn't work
http://www.generalmagic.org/gallery/Others -> no space, dooesn't work
http://www.generalmagic.org/gallery/Underwater/KeyLargo2006/Reef/2006-11-03_CRW_2984.jpg.php --> image in sub album, doesn't work but .php does show up now.
http://www.generalmagic.org/gallery/zen/admin.php works by the way.
So it might not be related to sub-albums and spacing. I am betting on user error in mod_rewrite/.htaccess/zenphoto configuration.
Any idea ?
# htaccess file for zenphoto
# NOTE: Change the RewriteBase below to the absolute path to your zenphoto directory.
<IfModule mod_rewrite.c>
RewriteEngine On
#### !!! Change this to the web path (eg: http://www.example.com/photos --> /photos) !!!
RewriteBase /gallery
####
RewriteRule ^admin/?$ zen/admin.php [R,L]
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule ^.*$ - [R,L]
RewriteRule index\.php$ index.php [L,QSA]
RewriteRule ^page/([0-9]+)/?$ index.php?page=$1 [L,QSA]
RewriteRule ^page/([A-Za-z0-9\-_]+)/?$ index.php?p=$1 [L,QSA]
RewriteRule ^(.*)/page/([0-9]+)/?$ index.php?album=$1&page=$2 [L,QSA]
RewriteRule ^(.*)/image/(thumb|[0-9]{1,4})/([^/\\]+)$ zen/i.php?a=$1&i=$3&s=$2 [L,QSA]
RewriteRule ^(.*)/image/([^/\\]+)$ zen/i.php?a=$1&i=$2 [L,QSA]
# Catch-all - everything else gets handled in PHP for compatibility.
RewriteRule ^(.*)/?$ index.php?album=$1 [L,QSA]
</IfModule>
And the admin will say 1.0.8, since the functions.php variable for version # is 1.0.8. I changed mine manually, but that's just a cosmetic thing I do to keep track of what version I'm using.
I noticed that an old URL such as:
http://www.generalmagic.org/gallery/index.php?album=Portfolio+2007/Rassain
does get rewritten as (what I imagine is correctly) :
http://www.generalmagic.org/gallery/Portfolio 2007/Rassain
Which would seem to indicate that my config doesn't seem to be able to deal with that path ?
Any thoughts Tristan?
That should be your first clue when none of the paths work ;-)
Also, your cache directory is not writable, but that's an entirely different problem :-)
http://www.generalmagic.org/gallery/zen/i.php?a=Portfolio 2007/Rassain&i=IMG_7493_4_5.jpg&s=thumb
Here's a phpinfo: http://www.generalmagic.org/phpinfo.php
You have your own server (or VPS) (Debian too, nice) so you'll probably need to add
`AllowOverride all`
in your directory configuration block to enable the use of .htaccess files to override the httpd conf. :-) Ex:
`
AllowOverride All
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
`
Thanks a bunch, you two !
Yeah, I had the same problem setting up my server. You have to configure a lot of things manually that you take for granted on shared hosting