druplal - embedded rewrite module and a root path

barkbarkuk

Joined: 2006-11-10
Posts: 8
Posted: Fri, 2006-11-10 12:54

I've got an embedded version of gallery2 (cvs) in drupal 4.7 and I'm using the gallery rewrite module but there is an error in the embedded .htaccess file it populates.
I can fix the rewrite rule by hand and I don't *think* it's user error that's causing the fault.

My drupal site is at the root path of my website '/', with gallery2 standalone at '/gallery2'. (The standalone site works just fine with the rewrite rules)

The problem is that links to albums generated by gallery2 all have a trailing '/', but this is incorrectly caught by the embedded rewrite rule:

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

The problem seems to be because the second RewriteCond is not anchored to the start of the path.
Modifying 'Htaccess.tpl' to output the second RewriteCond as:

  RewriteCond %{REQUEST_URI} !^/$

seems to fix the problem, without breaking the standalone install.

Sorry if this has been raised already, I searched but could not find.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2006-11-10 14:09
 
barkbarkuk

Joined: 2006-11-10
Posts: 8
Posted: Fri, 2006-11-10 15:02

That fixed it. Sorry to have wasted your time. Thanks.

I have to admit, I do remain a bit confused as to exactly what happened there as I was already using a very recent gallery.module from cvs and my gallery2 install was also recently pulled from svn.
I hadn't previously uninstalled the rewrite module or switched the gallery.module to automatic and back to manual again (auto doesn't work for me, I think because gallery2 isn't located under the drupal install on the filesystem) so am guessing that's what's fixed it.

Anyway, sorry again for the distraction, keep up the good work.