URL issues on Integrating Gallery 2 with Drupal 6

PeterBindon

Joined: 2006-08-27
Posts: 19
Posted: Thu, 2010-05-13 15:51

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.

Someone on the Drupal forum suggested using the auto config and then edit my .htaccess file. Unfortunately I'm not a .htaccess expert and whilst waiting for an answer I've tried dabbling unsuccessfully.

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

Quote:
# 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.....

Quote:
# 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

If it helps I believe there may be a problem with the manual config routine as I’ve noticed that the “test locations” passes ok with the gallery base showing as test/testgallery . However after the doing Step 4 it reverts the gallery base to the default of "gallery" overwriting my choice of "test/testgallery"

Suggestions for either changing the .htaccess code or a fix to the overwriting problem would be greatly received

Thanks

Peter