.httaccess solution?

Hi,
So, like many others here I ran into .htaccess problem that resulted with, well, nothing... in my gallery. My database was populated, images were in place, they were also downloading just fine, but they were not displaying at all. This is what I found in this little stinky file a few hours later:

Besides updating the path to my gallery I noticed that other rewriting rules were directing php functions to folder called "zen". There is no folder called "zen". Might have been in previous editions, though. I changed each instance of "zen" to current "zp-core" and VOILA! It works. Cruft free images, heck, IMAGES - I can finally see them! I am happy. Here is a copy of my updated file for your viewing pleasure:

`

# htaccess file for zenphoto

# NOTE: Change the RewriteBase below to the absolute path to your zenphoto directory.



RewriteEngine On

#### !!! Change this to the web path (eg: http://www.example.com/photos --> /photos) !!!

#### This is my re-written version!

RewriteBase /gallery

####

RewriteRule ^admin/?$ zp-core/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})/([^/]+)$ zp-core/i.php?a=$1&i=$3&s=$2 [L,QSA]

RewriteRule ^(.*)/image/([^/]+)$ zp-core/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]



`

Maybe that will help...

Comments

  • You should update your .htaccess file to the one that came with the release. There are a number of changes to it to support such things as rewrite rules for search.

    Whenever you load a new release of zenphoto, upload ALL the files that are included. Otherwise who knows what might go wrong!
  • I agree; .htaccess on macs is invisible without tinkering with terminal, and I did not even think of looking for it...
    Out of curiosity I will try to find it.
    (A while later...) Yup, you were right, it is there and it works like a charm. Silly me.
  • acrylian Administrator, Developer
    Radex7: I am mac user myself and you don't need to use the terminal if you are uncomfortable with it (as I am). You can just use a program like Invisibility Toggler (http://www.macupdate.com/info.php/id/24632/invisibility-toggler) or an FTP-clien to view the folders with invisible files. You should use FTP to upload anyway...:-)
  • You are right, acrylian, I found it with dreamweaver... I use Cyberduck for ftp access but I cannot find function to show files and folders on my computer, I just drag and drop.
  • acrylian Administrator, Developer
    Because of this one window principle I never got used to Cyberduck. I prefer Transmit instead (not free though).
  • On the Mac, you can use a program called TextMate to view and edit .htaccess files.
  • acrylian Administrator, Developer
    Then I would recommend TextWrangler instead that is a very good, slim editor with syntax highlighting. And it's free...:-):
    http://www.barebones.com/products/textwrangler/
Sign In or Register to comment.