Installed Drupal 5.5 in root, installed Gallery 2.2.3 in /gallery2. Gallery2 standalone is fine. Drupal is fine. After playing much with .htaccess as I am sure that's where the issue lies I am still stuck.

Issue is that when Gallery is launched within Drupal, the initial page and pictures/folders show fine. When I click on a picture, I am brought back to same screen, not a separate window/screen with picture alone or enlarged picture. When I click on a folder from initial page, it doesn't drill down, it again shows the same initial screen. No errors showing, just doesn't do anything beyond the main page.

If I go into Gallery standalone, everything works as it should.

Any help appreciated. The .htaccess isn't getting modified properly on install/configuation so I was messing with it. I have attached the text (from .htaccess in root) below. If anyone can spot the issue in it or what the issue could be please let me know asap. Does .htaccess need to be modified in /gallery2 or /files as well? Thanks much.

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.

Order allow,deny

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
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.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

# PHP 4, Apache 2.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

# PHP 5, Apache 1 and 2.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

# Requires mod_expires to be enabled.

# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1

# Various rewrite rules.

RewriteEngine on
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
#RewriteCond %{THE_REQUEST} /gallery/v/([^?]+)(\?.|\ .)
#RewriteCond %{REQUEST_URI} !/index\.php$
#RewriteRule . /index.php?q=gallery&g2_path=%1 [QSA,L]
#RewriteBase http://www.politeski.com/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_URI} !http://www.politeski.com/index\.php$
RewriteCond %{THE_REQUEST} http://www.politeski.com/gallery/v/([^?]+)(\?.|\ .)
RewriteRule . /index.php?q=gallery&g2_path=%1 [QSA,L]

# $Id: .htaccess,v 1.81.2.3 2007/09/21 12:24:22 drumm Exp $

Comments

vm’s picture

A) you should seriously consider using drupal 5.7 , you are 2 security releases behind and vulnerable to known exploits.
B) you should seriously consdier be using Gallery 2.2.4, you are 1 security release behund and vulnerable to known exploits

C) your problem may be the way you have set up your settings for G2 in drupal. A screencapture of those areas may help.
are sure the G2 url rewrite plugin is properly set up?

dpoliteski’s picture

For A & B, to make setup easier I am using 5.5 and 2.2.3 as my hosting provider GoDaddy provides scripts to automatically install them. I did an upgrade on my older Gallery installation and had sooooo many files that it said I had to manually delete as I can't execute files on the server.

For C, I confirmed what the documentation said were the proper settings and had the paths setup correctly.

Should be easy since Drupal is root / and Gallery is /gallery2. No multi-site etc..

Anyone have a similar install, where I can see the .htaccess?

Thx.

dsp1’s picture

VeryMisunderstood is right, you should use the newest versions.

did you paste in the # Various rewrite rules yourself?
the module will add most of what you added yourself if you have mod_rewrite.

at the top of htaccess you should have something like the following.

# 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/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]
    RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/index\.php$
    RewriteRule .   /index.php?q=gallery&g2_path=%1   [QSA,L]
</IfModule>

do you have mod_rewrite installed on your server?

why did you add RewriteCond with www.politeski.com?

dpoliteski’s picture

Mod_rewrite is installed on all severs according to the hosting company GoDaddy. For the RewriteCondition, that actually got added automatically by enabling the integrated Gallery Rewrite... I was messing around where they were placed in the .htaccess. Whenever i had the rewritecond www.politeski.com nothing worked, just an error so I commented out that line.

I am just not familiar with the rewrite module in .htaccess and the lingo. Was hoping most of it would be done when enabling the modules. No errors when enabling, so thought things would be smooth.

Thx.

profix898’s picture

I really doubt that your rules above got added automatically as dsp1 mentioned. You always get this "# BEGIN Url Rewrite section ..." stuff added by G2 at the very beginning of .htaccess. Also your rules should not contain http://www.yoursite.com/... Please go to the "Embedded Setup" section on the "Setup" tab in your G2 "URL Rewrite" options. The second line asks you: "Please enter the Url to your environment". You should put a simple "/" in there, NOT the full URL to your site. (This form is actually a bit confusing. If you take a close look at the form, you will notice a "http://www.yoursite.com" string above the textfield. So your are only asked to complete the url (with your local path/subfolder), not to enter the whole location.)

dpoliteski’s picture

Thx all for suggestions, esp Profix898 for what seems to be the solution...

The second line asks you: "Please enter the Url to your environment". You should put a simple "/" in there, NOT the full URL to your site. (This form is actually a bit confusing. If you take a close look at the form, you will notice a "http://www.yoursite.com" string above the textfield. So your are only asked to complete the url (with your local path/subfolder), not to enter the whole location.)

Seems to have done the trick... thx.

One last question to those who might know. Since enabling re-write, any sub folders under root all do to drupal saying Page not found. I have my Drupal in root. Gallery in \gallery2. That works now. But any other folder for friends who are on my webserver space like \DVD all give the "Page Not Found | Drupal" message and not reading the default index.htm in that other folder. How hard would this be to change? I only want Drupal and Gallery involved in this Drupal installation.

Thanks much guys/gals,
Dan.