drupal 6 multisite + embded gallery 2.3 redirect problem

alforddm

Joined: 2011-04-20
Posts: 13
Posted: Wed, 2011-09-07 16:52

I have a multi-site drupal + multisite embedded gallery2 install. Everything has been working great until I decided to change my drupal multisite install to a sub-directory install vs a sub-domain type install.

I think this has to be related to the redirect rules because when I turn off the gallery2 clean url mod everything works fine. I have only a very vague understanding of how the redirect is working and got it working the first time by simply following the instructions =) I hope someone can help me out with this one.

the installation is colorgenetics.info/feline/gallery and colorgenetics.info/canine/gallery With the standalone gallery2 installs at colorgenetics.info/feline_gallery and colorgenetics.info/canine_gallery

the redirect rules are as follows to get the drupal install to work in the sub-directory this was necessary.
just for the feline site
Code:

   
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/feline/(.*)$
RewriteRule ^(.*)$ /feline/index.php?q=$1 [L,QSA]

for the gallery2 installation just the feline site since the others should be similar
Code:

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

    RewriteCond %{THE_REQUEST} /d/([0-9]+)\-([0-9]+)/([^/?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery$
    RewriteRule .   /feline_gallery/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]
    RewriteCond %{THE_REQUEST} /feline/gallery/v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery$
    RewriteRule .   /gallery?g2_path=%1   [QSA,L]

And the .htaccess file from the feline_gallery folder
Code:

# BEGIN Url Rewrite section
# (Automatically generated. Do not edit this section)

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /feline_gallery/

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

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

# END Url Rewrite section

I can turn off the gallery2 rewrite mod if I have must to get things working but I would rather not as that will of course break any links that are out there.

Edited to add: When the redirect enabled in gallery2 I can see the page at colorgenetics.info/feline/gallery but when I click on an album instead of going to the album the clean url link will show in the address bar but page that shows is the gallery home page. For example the url will show colorgenetics.info/feline/gallery/v/album but the page shown will be colorgenetics.info/feline/gallery If i try to go to a picture page directly I get a page not found error.

Thanks in advance for the help

 
alforddm

Joined: 2011-04-20
Posts: 13
Posted: Sat, 2011-09-10 18:05

Anyone on this? Maybe even redirect the clean urls to the non-clean ones that are currently working?

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-09-10 22:14

Your best option is to uninstall and reinstall the url rewrite module in G2 (note: Not deactivate and reactivate) and then go look for the installation instructions for the Drupal bridge and treat things like a new installation.

If you were able to follow the instructions once, you'll be able to follow them again.

--
dakanji.com

 
alforddm

Joined: 2011-04-20
Posts: 13
Posted: Sun, 2011-09-11 02:04

I just wanted to say thank you and that completely uninstalling the url rewrite in gallery2 and reinstalling everything did the trick.

Thank you!

 
alforddm

Joined: 2011-04-20
Posts: 13
Posted: Sun, 2011-09-11 15:07

Well this isn't as resolved as I thought. Although now all the gallery clean urls work inside drupal, my main site is getting redirected to one of the sub-sites.

The code that is causing the problem is the ReWriteBase /feline/. However, if I try to remove this line of code the clean urls stop working. I've also tried placing the below code at the top and bottom of my .htaccess file but the result is either the main site is redirected to /feline/ or the clean urls stop working in the embedded gallery.

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

    RewriteCond %{THE_REQUEST} /feline/d/([0-9]+)\-([0-9]+)/([^/?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/feline/index\.php$
    RewriteRule .   /feline_gallery/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]
    RewriteCond %{THE_REQUEST} /feline/gallery/v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/feline/index\.php$
    RewriteRule .   /feline/index.php?q=gallery&g2_path=%1   [QSA,L]
 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2011-09-11 15:41

Clear your browser cache.

I can navigate to "http://colorgenetics.info/feline/gallery/v/extension/800px-Amberkater.jpg.html" and see the site in Drupal or "http://colorgenetics.info/feline_gallery/gallery/v/extension/800px-Amberkater.jpg.html" and see it in G2.

--
dakanji.com

 
alforddm

Joined: 2011-04-20
Posts: 13
Posted: Sun, 2011-09-11 15:52

Yes, that part is acting correctly, but if you navigate to colorgenetics.info/forum or colorgenetics.info/gallery it will rewrite the base to the feline site. With colorgenetics.info/gallery you should get a 404 error as there isn't a gallery installed.

Is it possible that I just have the rules in the wrong spot in my .htaccess file? I also have boost installed. I can post more of my .htaccess file if needed.

 
alforddm

Joined: 2011-04-20
Posts: 13
Posted: Sun, 2011-09-11 17:01

Finally! I think everything is working now. I had to go in to the setting.php files for the drupal sites and set the baseurl variable. After I did this I was able to remove the RewriteBase directive from the .htaccess file and walla! everything worked (well after I reinstalled the gallery plugin for one of the sites multiple times. I have no idea what is up with that one but I had to do the same thing the other day to get the clean urls working again *shrug*).

Thanks again for your help!