Gallery Link Displays the directory

Hi,
Whenever I go to http://localhost/zenphoto/index.php and navigate into my album and pictures, there is a breadcrumb links that are created at the top of the page.

Gallery-Album Name-Picture Name

When I click on Gallery, it displays the structure/director showing the folders and files.

What file and what do I need to modify to prevent the viewer clicking on Gallery and seeing my directory structure? Zp-config.php or .htaccess file? Thanks in advance.

Comments

  • You probably have copied your theme index.php file into the zenphoto folder. There should be no breadcrumbs on the gallery index. I suggest you remove all the zenphoto files and reload from the original. Run setup and start again.

    If this does not work, post the real link to your album so we can investigate.
  • The index.php file is located in c:\...\htdocs\zenphoto. This is where the setup program put it. Should I move the index.php file one level up and put it in c:\...\htdocs? I am afraid that running the setup again will result in the same issue.
  • There should be an index.php file in htdocs\zenphoto. But from your report it seems it might not be the correct one. Again, without the ability to view your site the only advice I can give you is to remove and reinstall the zenphoto files to be sure that the correct ones are in the right place.
  • Whenever the user goes to http://localhost/zenphoto/

    They see:

    Index of /zenphoto
    Parent Directory
    License.txt
    README.html
    albums/
    cache/
    example_robots.txt
    index.php
    lighttpd-rewrite.txt
    rss-comments.php
    rss.php
    themes/
    zp-core/

    How do I prevent the user from seeing this?
  • acrylian Administrator, Developer
    Please do a complete reinstall of zenphoto, there is apparently something missing.
  • I did re-install. Even on another computer. I am still getting the same issue.
  • Okay,
    Try this, go to this link from the ZenPhoto Demo.

    http://www.zenphoto.org/zenphoto/impressionists/Monet+-+sunrise.jpg.php

    This is what I am trying to have happen

    Click on the top left on Demo Gallery (Look on the status bar below and see that it is going to http://www.zenphoto.org/zenphoto/)

    This should take you back to the Albums Index

    What happens for me is it shows the directory structure instead of displaying the Albums Index.
  • Does your server have PHP scripting enabled? If so, it should load the index.php file and not produce a folder listing.

    Can you provide the URL to your gallery? That way we can take a look.
  • Yes, I can not give you the URL, because this all running locally on my machine. Do I need to change somethng in the htaccess file by default? It looks like when I am viewing a picture, that it does not know to load index.php when I click on Gallery (Albums Index).
  • You should not have to make any changes--setup should have done anything needed. So, if it has not reported a problem.

    Loading index.php is a function of your server. Maybe you do not have the right options set.
  • acrylian Administrator, Developer
    txzen: How is your server setup? Do you use anything like WAMP? I never had these problems running MAMP on a Mac.
  • No I do not user WAMP. I guess what I need to know is when I click on the Albums Index, it points to http://localhost/zenphoto/. Behind the scene it should load index.php. But when I click on it, it just shows a directory structure. Where in the file can I modify this to point to index.php? This same issue occurs when I just try to go to http://localhost/zenphoto without specifying a filename. Thanks guys for helping me out.
  • acrylian Administrator, Developer
    Just to ask without being a server expert, are you sure that you localhost is really setup right?
  • You cannot modify anything in zenphoto to fix this. THIS IS A SERVER PROBLEM. You have to fix your server configuration.
  • Okay, I figured it out. Thanks for your help guys. This is how I resolved this issue.

    Create a file called index.html (This is the file that Apache looks for (This is set up in http.conf))
    Wrote a javascript redirect code to point to the index.php file

    Works like a charm. Thanks again guys.
  • trisweb Administrator
    Okay okay okay, sorry I didn't see this sooner. You guys were on a wild goose chase...

    Clearly the problem is that index.php isn't set as a default file for directories under Apache (or whichever server you're using).

    If it's Apache, you need to edit your apache.conf or httpd.conf (main Apache config file) and find the DirectoryIndex line. It should read:

    `DirectoryIndex index.html index.htm default.html` or something similar.

    Change it to:

    `DirectoryIndex index.html index.htm default.html index.php` and whichever other directory default files you want, but definitely add the index.php to that line :) That should do it.

    Read more here...
    http://httpd.apache.org/docs/2.0/mod/mod_dir.html
  • acrylian Administrator, Developer
    Not all ISPs allow that. I add this as a FAQ to our user guide.
Sign In or Register to comment.