Gallery2 - URL Rewrite - Show Item

Knobbyman

Joined: 2003-07-22
Posts: 2
Posted: Fri, 2006-09-15 00:14

Gallery2 works great until I enable URL Rewrite - Show Item.

When I do that I loose access to all my images.
Here is a example..

Disabled - http://www.knobbyman.com/main.php?g2_itemId=7217
Enabled - http://www.knobbyman.com/v/Funny/greybomber.jpg.html

I've left the setting disabled because it shows the same error either way..
What can I do to solve this problem? I'd like to be able to access my pictures directly. I'm sure you guys are going to need some more information so just let me know what other files you need to see or what ever.

Thanks.
-Eric

Login or register to post comments
ichthyous

Joined: 2006-06-16
Posts: 277
Posted: Sun, 2006-09-17 17:28

Check your .htaccess file for conflicting rewrite rules. This happens to me all the time when I play with URL rewrite...if any two rules are the same then gallery seems to just redirect you back to the main page. If you aren't familiar with the code for Apache rewrite mods then perhaps someone on here can help you with the code

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Fri, 2008-10-24 10:32

I have a similar problem, with the latest Gallery version: as soon as I enable 'Show Item' -> pictures gone.

Has this problem been resolved?

Regards,
Evert

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Fri, 2008-10-24 17:44

meulie,
works for me and others.

examples please?

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Fri, 2008-10-24 18:11

Sure. Here's my .htaccess before enabling 'Show Item':

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   -   [L]

    RewriteCond %{THE_REQUEST} /sitemap(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=sitemap.Sitemap   [QSA,L]
    RewriteCond %{THE_REQUEST} /popular(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=dynamicalbum.PopularAlbum   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)/slideshowapplet\.html(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=slideshowapplet.SlideshowApplet&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)/slideshow\.html(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=slideshow.Slideshow&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /key/([^?/]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /f/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_controller=permalinks.Redirect&g2_filename=%1   [QSA,L]
</IfModule>

# END Url Rewrite section

Then I enable 'Show Item', and get:

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   -   [L]

    RewriteCond %{THE_REQUEST} /sitemap(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=sitemap.Sitemap   [QSA,L]
    RewriteCond %{THE_REQUEST} /popular(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=dynamicalbum.PopularAlbum   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)/slideshowapplet\.html(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=slideshowapplet.SlideshowApplet&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)/slideshow\.html(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=slideshow.Slideshow&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /key/([^?/]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /f/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_controller=permalinks.Redirect&g2_filename=%1   [QSA,L]
</IfModule>

# END Url Rewrite section

My albums no longer show...

Regards,
Evert

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Fri, 2008-10-24 18:41

Uninstall the module. verify that .htaccess is empty.
Install, test activate and test. Activate one rewire rule one at a time and see where it gets you.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Fri, 2008-10-24 20:12

Done. With only 'Show Item' activated in the module I get the following .htaccess:

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   -   [L]

    RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/main\.php$
    RewriteRule .   /main.php?g2_path=%1   [QSA,L]
</IfModule>

# END Url Rewrite section

and no albums showing...

Regards,
Evert

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Fri, 2008-10-24 20:38
Quote:
and no albums showing...

I don't understand.
URL?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Fri, 2008-10-24 20:40

I enable only the view rule, it works for me:
http://4megs.com/gallery2/main.php

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Fri, 2008-10-24 21:03

Check http://photo.meulie.net/

(I will revert back to a working config in a couple of hours. With this broken config no one can see my pics...)

Regards,
Evert

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Fri, 2008-10-24 21:04
floridave wrote:
I enable only the view rule, it works for me:
http://4megs.com/gallery2/main.php

Dave

and does your .htaccess look identical/similar to mine?

Regards,
Evert

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Fri, 2008-10-24 22:01

For some reason, your page is not finished. Looking at the source is just stops :

....
....
<script type="text/javascript">
// <![CDATA[
function albumSelect_goToNode(nodeId) {
document.location = new String('

Change it back and we can compare the source to see where it dies.
Do you have a album name with a single quote in it or some other special character?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Fri, 2008-10-24 22:02

Please disable the album tree to see if that it truly the cause.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Fri, 2008-10-24 22:17
floridave wrote:
Please disable the album tree to see if that it truly the cause.

YES! The album tree is the problem! As soon as I disabled it, all works the way it should. I will go through all folder names to see which one could be the cause...

Regards,
Evert

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Fri, 2008-10-24 22:21

It might be your root album:
"Evert's " has a single quote.
See if that is it. If it is I wil try to reproduce and file a bug.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Fri, 2008-10-24 22:42

Thank you for all the help. As you all can see, my albums are now working the way they should, including all the rewrites I want. :-)

Regards,
Evert

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Fri, 2008-10-24 22:52

I added a album tree on my test site:
http://4megs.com/gallery2/main.php as well as change the name of the root album. I can't reproduce so I will leave this for now.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Sat, 2008-11-01 19:52

Hi again!

I've done some testing, and I am actually able to re-create the problem by letting PHP handle the re-write, instead of .htaccess.
Therefore my problem must be caused on a deeper/different level, I think...

My main album no longer has any quotes in its name, and both .htacess & php-rewrite give me the same problem: no albums showing as soon as I enable 'Show Item'.

I have also located the culprit: As soon as I remove 'Album quick links (DHTML)' from the Matrix theme, all works the way it should. I guess I will keep that disabled for the time being...

Regards,
Evert

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Sun, 2008-11-02 00:12
Quote:
by letting PHP handle the re-write, instead of .htaccess.

I don't understand. G2 has the rewrite rules that write a new .htaccess file.

So how to reproduce?
Enable the show item and give the matrix theme a DHTML album select list?
Seems to work for me.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
meulie
meulie's picture

Joined: 2003-09-12
Posts: 46
Posted: Sun, 2008-11-02 09:59

I'm not sure on how to reproduce... There is something in my Gallery-database that is not liked by the DHTML album select plugin, that's all I know... Are there any characters that should not be used in album names? That make the DHTML plugin barf?

Regards,
Evert

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Mon, 2008-11-03 00:08
Quote:
Are there any characters that should not be used in album names? That make the DHTML plugin barf?

Not that I can find.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16320
Posted: Wed, 2008-11-05 04:52

I think I was able to see this issue, but not able to reproduce. Not really sure, but I saw the same symptoms. Clearing cache in /lib/support seemed to have fixed it for me.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments