I'm setting up a new site (switching web hosts and starting the site over) and am using Drupal 5.2, Gallery 2.2.3, and beta3 of the embedding module. Clean URLs are working for Drupal and URL Rewrite is configured correctly (I think!) for Gallery (done from Drupal, not standalone) - however, links to the albums have a trailing slash and lead to a Page Not Found error. They work fine if I access Gallery directly, and the links from Gallery_Menu are different ("/gallery/21" instead of "/v/cars/" for example) and those do work fine. BTW, gallery_menu is working now for me with beta3 whereas beta2 was failing, so thanks for that fix. :) Removing the trailing slash manually brings the page up. I tried editing the htaccess to remove the trailing slashes but they were still there.
I've attached the htaccess file. I'm not sure if the problem is a bad htaccess file or a problem with the embedding?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | htaccess_3.txt | 4.47 KB | profix898 |
| htaccess_2.txt | 4.48 KB | Groucho |
Comments
Comment #1
profix898 commentedActually your links should be
/gallery/v/cars/instead of just/v/cars/. I guess you missed to configure the rewrite rules in G2 as described at http://codex.gallery2.org/Gallery2:How_to_Embed_Gallery2_in_Drupal#URL_R...You should have the
Show Itemrule configured asgallery/v/%path%and theDownload itemrule asgallery/d/%itemId%-%serialNumber%/%fileName%.Comment #2
Groucho commentedThanks for the response! You are right, I hadn't changed that setting. Unfortunately, that didn't seem to help, in fact it caused a new problem.
I'm not sure if the "/v" should be there - your examples have it, but the linked page indicates that it's not necessary. I tried it both ways and had the same problem - all albums show the root of the gallery, even though the URL displayed is correct. For example, it can take /gallery/cars or /gallery/v/cars but still show the root albums. I did some searching but wasn't able to find a clear answer. HOWEVER, my workaround that I was able to get working after posting the original message will probably work again - I commented out all the lines in .htaccess that were adding the trailing slash and things seems to be working quite well. I noticed that with the current issue, removing the trailing slash lets it go into the album properly. So there's still some "trailing slash" issue as far as I can see.
Comment #3
profix898 commentedNot sure there is really a bug in the module. For me (and I guess for others as well) it works like it is now. Here are my settings, so that you can compare with you own.
I have Drupal installed in a subdirectory 'drupal5' on my domain, e.g. http://localhost/drupal5/index.php
The G2 installation is located at http://localhost/drupal5/gallery2
The filesystem paths look like /www/htdocs/drupal5 and /www/htdocs/drupal5/gallery2
Public path to your .htaccess file: '/drupal5/'
Filesystem path to your .htaccess file: '/www/htdocs/drupal5'
Rewrite rules are configured as described above. My .htaccess file is attached to this post.
Comment #4
Groucho commentedThanks for the htaccess. There are a few differences. Obviously your Drupal is in a subdirectory and mine's in the root, but I don't think that should matter. The big difference I notice is that at end of the Rewrite rules, you have a line that reads:
"RewriteCond %{REQUEST_URI} !/drupal5/index\.php$"
Whereas in mine, the same line is:
"RewriteCond %{REQUEST_URI} !/$"
I'm pretty convinced that this line is where the problems lie. If I comment that line out, everything appears to work perfectly for me, with or without a /v in there.
I tried going into the URL Rewrite Administration page and putting in "/index.php" in the "URL to your environment", but that didn't work - for one thing, it immediately changed in to "/index.php/" and while the line in htaccess that I quoted above was then very similar, it just had "!/index.php$" not "!/drupal5/index\.php$" - so perhaps it wasn't parsed correctly without the backslash before the period?
I have to think that there's something with the code and how it manipulated the htaccess - my site was 100% brand-new with clean and standard installs of the latest Drupal and Gallery. The only tricky thing was a little juggling needed when upgrading from Beta2 to Beta3 - I needed to properly disable then re-enable the troublesome gallery_menu module, which took a few steps but I was able to do, and that part appears to work fine at this point (although as I mentioned earlier, it links different URLs than Gallery itself.)
Comment #5
Groucho commentedUgh, I seem to be making it worse. :( Now the gallery_menu module links aren't working - they just take you to a blank page, and I'm getting big error messages sometimes when accessing the main Gallery page or going to the Drupal admin page from Gallery. Reloading the page then works properly. I think that I have everything the way it was, but I wasn't having these problems a few hours ago. I'm beginning to question if rewrite is worth it...
Comment #6
Groucho commentedI thought I'd add the latest status. I disabled the gallery and gallery_menu plugins, deleted the integration module folders and re-uploaded them (probably not necessary, but I wanted to make 100% sure it was clean). I then enabled the Gallery module only. I followed the instructions in the link in the first response here (originally I was following the longer instructions for the older mod that uses Gallery 2.1) and it seemed to be working perfectly. (FWIW, my rewrite rules do NOT currently include the /v and /d in them and it doesn't seem to matter.)
I then enabled the Gallery_menu plugin and things still seem to be working OK - except for the actual Gallery menu. Those, as I mentioned earlier, use different links (/gallery/21 instead of /gallery/cars) and following those links leads to a white page, and I then hit "back" and the next page I load includes an error at the top though it displays correctly, and the error goes away when reloading the page.
So from what I can see, the issues are related to Gallery_menu module.
Comment #7
profix898 commentedThanks for the update. For me gallery_menu.module works correctly as well. However I agree that URL Rewrite handling can be improved overall. Marking this 'fixed' as you mentioned gallery.module working at least. For gallery_menu path improvements let's continued in http://drupal.org/node/176859.
Comment #8
(not verified) commented