Rewrite configuration in .htaccess breaks other sites in multisite configuration

scottgifford - August 17, 2009 - 05:15
Project:Gallery
Version:6.x-1.0
Component:Code / API
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I have a multisite Drupal configuration, with all sites sharing the same Drupal root. When we activate Gallery on one of those sites, the rewrite rules it adds to the .htaccess in the Drupal root breaks other sites. Here are the rules it is adding:

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

# END Url Rewrite section

Any suggestions for working around this?

#1

lvthunder - August 17, 2009 - 14:27

What do you mean when you say it breaks others sites? I have the same setup as you but I'm not having any problems. The only difference is that I use G2 on both sites. Maybe a link to a couple sites would help?

#2

scottgifford - August 17, 2009 - 15:26

I have fixed the sites by adjusting the directory arrangement, but basically any page besides the front page would not load, it gave a 404 error. I could see from the logs the request was being rewritten incorrectly.

Part of the problem may have been that the broken site ran in a subdirectory of the domain, that is, http://www.suspectclass.com/sgifford instead of just http://www.suspectclass.com/ ; looking at the rewrite rule, that may have confused it.

#3

lvthunder - August 17, 2009 - 15:35

Well now http://www.suspectclass.com redirects to http://www.suspectclass.com/sgifford. Did you fix the issue? My multisites are a different subdomains instead of just folders.

#4

scottgifford - August 17, 2009 - 15:41

Yes, I fixed the issue. Some of our multisites are different domains, others are different subdirectories.

#5

scottgifford - August 17, 2009 - 15:42

I should mention that the reason I'm reporting the problem even though it's fixed is that when the Gallery module is re-installed or installed on a new site, it makes the same .htaccess changes and breaks our other sites again.

 
 

Drupal is a registered trademark of Dries Buytaert.