I’m currently trying to embed Gallery2 into Drupal and are having problems with the way I’m trying to get the install to work.

My test scenario has gallery2 set up within ….com/gallery2/testgallery

Within Drupal I’m wanting to access using ….com/test/testgallery rather than the default of ….com/gallery

I enter the following parameters in the Auto Configuration for the location settings
Gallery2 URL or URI: /gallery2/testgallery
Gallery base (optional): test/testgallery

The result is that I get a menu item called Gallery which when I click on it it takes me to ….com/test/testgallery which is what I want. However when I click on an album (in my test called 2010) I get page not found which has a URL of ……com/index.php?q=test/v/2010/

I therefore tried using the Manual Configuration option for the location settings and enter the following parameters
Gallery2 URL or URI: /gallery2/testgallery
Gallery2 filesystem path: . /gallery2/testgallery
Embed URI: test/testgallery/index.php?q=gallery
Gallery base (optional): test/testgallery

The result is again that I get a menu item called Gallery. However this time when I click on it it takes me to ….com/gallery (not what I wanted). When I click on an album (again called 2010) it takes me to …..com/test/testgallery/v/2010/ which is exactly what I want.

Can anybody help with this problem. I’ve noticed that the “test locations” passes ok with the gallery base showing as test/testgallery . However after the doing the Step 4: Clean URLs / URL Rewrite settings step it reverts the gallery base to the default of gallery overwriting my choice of test/testgallery

Thanks

Peter

Comments

PeterBindon’s picture

Title: URL issues on Integratign Gallery 2 » URL issues on Integrating Gallery 2
lvthunder’s picture

Do it the first way and then look in your .htaccess and manually make the changes that points to where you want them to be. I have no idea why you want test everywhere, but maybe that's just me.

PeterBindon’s picture

Thanks for quick response. I'm wanting to make these changes to allow all existing links out there on the internet on forums, etc. to still be valid links. The word test is only what I'm using to try things out before making the changes for real.

Unfortunately I'm not a .htaccess expert so can you point out the changes I need to make to what I am assuming is the relevant section.

This is it via auto config......

# 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} !/testgallery$
    RewriteRule .   -   [L]

    RewriteCond %{THE_REQUEST} /d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/testgallery$
    RewriteRule .   /gallery2/testgallery/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)\.davmount(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/testgallery$
    RewriteRule .   /testgallery?g2_view=webdav.DownloadDavMount&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /w(/[^?]*)?(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/testgallery$
    RewriteRule .   /testgallery?g2_controller=webdav.WebDav&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/testgallery$
    RewriteRule .   /testgallery?g2_path=%1   [QSA,L]
</IfModule>

# END Url Rewrite section

This is it via manual config.....

# 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} !/index\.php$
    RewriteRule .   -   [L]

    RewriteCond %{THE_REQUEST} /d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/index\.php$
    RewriteRule .   /gallery2/testgallery/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)\.davmount(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/index\.php$
    RewriteRule .   /index.php?q=gallery&g2_view=webdav.DownloadDavMount&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /w(/[^?]*)?(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/index\.php$
    RewriteRule .   /index.php?q=gallery&g2_controller=webdav.WebDav&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/index\.php$
    RewriteRule .   /index.php?q=gallery&g2_path=%1   [QSA,L]
</IfModule>

# END Url Rewrite section
PeterBindon’s picture

(polite) bump

lvthunder’s picture

I'm not really sure what in .htaccess you need to change. Another thing you might need to look at is the base path in G2's config.php. Also try turning Clean URL's (Drupal) and rewrite (G2) off and seeing if it works. If it does it is .htaccess problems. If not it is something else.

PeterBindon’s picture

OK Thanks for the reply.

Unfortunately yesterday the drupal parts of my site was broken - very broken - I was getting WSOD everywhere. I finally tracked it down to a php memory problem with gallery2 being embedded into drupal. Of course I couldn't get into my admin pages to turn it off. In the end I renamed the folder gallery2 was sitting in and everything was back again. I've currently uninstalled the gallery module just to make sure.

I feel plan B coming along. Thanks for your help anyway.