G2 embedded in Drupal - G2 Clean URLs fail to work properly.

dbmathis

Joined: 2003-12-10
Posts: 52
Posted: Tue, 2006-06-06 20:45

Hi all,

I am using G2 embedded into Drupal and I am not able to get 'Clean URLs' to work for gallery2 while gallery2 is embedded in Drupal. Clean URLs work fine for Gallery2 while gallery2 is in standalone mode. Clean URLs work fine for Drupal while Drupal is standalone and while gallery2 is embedded in Drupal. Gallery2 Clean URLs break when it is embedded. I have spent the last 3 days trying to figure this out and I am at a deadend.

When gallery2 is embedded, the embedded gallery root is displayed, and when my mouse hovers over the albums it appears to display the correct Clean URLs. When I click on the gallery block photo or an album I am just brought to the main/root embedded gallery page.

Does anyone know why this might be happening?


Root .htaccess file


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


    RewriteCond %{THE_REQUEST} \ /gallery/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/index\.php$
    RewriteRule .   /index.php?q=gallery&g2_view=core.ShowItem&g2_path=%1   [QSA,L]

</IfModule>

# END Url Rewrite section

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch 

"(\.(engine|inc|install|module|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root)$">
  Order deny,allow
  Deny from all
</FilesMatch>

# Set some options.
Options -Indexes
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
</IfModule>

# PHP 4, Apache 2
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
</IfModule>

# PHP 5, Apache 1 and 2
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
</IfModule>

# Reduce the time dynamically generated pages are cache-able.
<IfModule mod_expires.c>
  ExpiresByType text/html A1
</IfModule>


# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the prefix www.
  # you can use one of the following settings to force user to use only one option:
  #
  # If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
  # RewriteRule .* http://www.example.com/ [L,R=301]
  #
  # If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
  # RewriteRule .* http://example.com/ [L,R=301]


  # Modify the RewriteBase if you are using Drupal in a subdirectory and
  # the rewrite rules are not working properly.
  #RewriteBase /drupal

  # Rewrite old-style URLs of the form 'node.php?id=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x'.
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

  # Rewrite current-style URLs of the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id: .htaccess,v 1.73 2006/04/14 09:08:26 killes Exp $


Screenshots

Standalone Gallery with clean URLs:
http://www.tmfamily.info/support/gallery_clean_urls.jpg

Drupal with clean URLs:
http://www.tmfamily.info/support/drupal_clean_urls.jpg

Embedded Gallery rules:
http://www.tmfamily.info/support/gallery-embedded_rules.jpg

Embedded Gallery setup:
http://www.tmfamily.info/support/gallery-embedded_setup.jpg

Embedded Gallery test:
http://www.tmfamily.info/support/gallery-embedded_test.jpg

Embedded Gallery hover:
http://www.tmfamily.info/support/gallery-embedded_hover.jpg

Drupal -> Settings -> Gallery (ERROR):
http://www.tmfamily.info/support/drupal_settings_gallery_error.jpg


Related articles that I have read:

http://gallery.menalto.com/node/38019
http://codex.gallery2.org/index.php/Gallery2:How_to_Embed_Gallery2_in_Drupal
http://gallery.menalto.com/node/49132


System information


Gallery version (not just "2"): Gallery 2.1 Blackjack
Module / Theme name & version: Drupal version 4.7.1 / gallery module 4.7.0 / Matrix Theme
PHP version (e.g. 4.3.11): 5.1.2
PHPInfo Link (see FAQ): http://www.tmfamily.info/phpinfo.php
Webserver (e.g. Apache 1.3.33): Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color
Database (e.g. MySql 4.0.11): 5.0.20
Activated toolkits (e.g. NetPbm, GD): NetPbm, GD
Operating system (e.g. Linux): Windows XP Professional
Browser (e.g. Firefox 1.0): IE 6 sp2

 
kiz_0987

Joined: 2005-02-27
Posts: 189
Posted: Tue, 2006-06-06 22:01

I think I can see why the gallery.module autoconfig failed. There is a search/replace of the gallery.module dir that is not happening here so the directory is wrong -- this is likely caused by the '\' instead of '/' path separator. I'll look at it.

However, your .htaccess file does look right to me (quite similar to mine). I do not know why it does not work. With the 4.7 version of gallery.module you can set rules for all items (except admin) so I suggest trying one of the others (comments, download etc) and seeing what happens.

 
dbmathis

Joined: 2003-12-10
Posts: 52
Posted: Wed, 2006-06-07 00:07

I enabled the comments and download and still no luck.

 
dbmathis

Joined: 2003-12-10
Posts: 52
Posted: Sun, 2006-06-11 02:03

So nobody knows why this is happening?