I would like to set up URL Rewrite (0.9.3) in a drupal embedded gallery. I'm using CVS from 2 days ago (beta 2 with cvs mods). Is this possible?
I set up the "Embedded Setup" for URL rewrite with the following:
Htaccess path: - can this be the same as my drupal .htaccess? When I save this and then select and save the rules it seems to change the .htaccess file OK. For now though I'm using an alterate path (drupal/tmp) to avoid any conflict. Any restriction on where this can be?
Public Path - should this be the public path to my embedded drupal? Probably I thought.
I tried a "Test" which runs through fine for the first 2, but then does not provide any reponse (good or bad) to the embedded test.
With the current way it's configured my short urls end up like http://mysite/drupal/v/MyAlbum/
but this does not link to the correct album.
But the drupal embedded mode uses a "gallery" module so that it's url (short for drupal, normal for gallery) is something like:
http://mysite/drupal/gallery?g2_view=core:ShowItem&g2_itemId=2920
mod_rewrite works and I have it running for short drupal urls.
Thanks.
Posts: 32509
pelle (rewrite) and walkah (drupal) will probably know the answer.
it seems that the short url, http://mysite/drupal/v/MyAlbum/ , should be slightly different. i'd expect something like http://mysite/drupal/gallery/v/MyAlbum/ ...
Posts: 389
There's a typo in the test, update your cvs and the test result should show up.
@Htaccess Path: It should be the same as your drupal htaccess
Posts: 189
Thanks. I updated to fix the typo and the embedded check now works OK. But I still cannot get URL Rewrite to work with Drupal. I can see the thumbnails in the main page but clicking a link gives a file not found error.
I have set the following:
Htaccess path: /var/www/html/drupal
Public path: http://crocus.local/drupal/
I have included the .htaccess file below (which is shared with Drupal's mod_rewrite rules). I also tried a public path of http://crocus.local/drupal/gallery but that gave a "Too many rules" error.
Any ideas would be appreciated.
Posts: 389
Intresting, looks like baseFile is a full URL instead of a file. You see the thumbs because you didnt activate the short style URL for downloads.
valiant, is this normal for embedded mode? I thought baseFile was a file.
You should probably move the Gallery section before Drupal since it has
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Posts: 32509
pelle, they can set baseFile to be a full url. i don't like that either.
usually, baseFile and embedPath are set with baseFile being something like 'index.php?module=gallery2' and embedPath = '' or '/drupal' . But baseFile = 'http://domain.com/drupal/index.php?module=gallery' is also allowed. for whatever reason.
Posts: 189
I tried a couple of ways and either will work.
1) Just modify the .htaccess file to change to
But then the rules would not be rewritten correctly if I changed them.
2) Modified gallery.module in drupal so that $embedUri is relative by setting:
$embedUri = url('gallery', NULL, NULL, FALSE);
The FALSE at the end stops it from being an absolute URL. If this checks out as OK I'll add this as a request to the gallery module.
Using 2) the rules are correctly generated by URL Rewrite but I then manually edit to move them above the Drupal rules as you suggest. Not a big deal.
One usability comment on the URL Rewrite module "Rules" tab. If I add a rule and then come back at a later date and want to add another you have to check both or the original rule is disabled. There is no indication by the checkbox whether it is already there or not.
Thanks for your help.
Posts: 389
This should only be needed once, as URL Rewrite replaces the current section whenever updated.
When the page is loaded and the checkbox is checked - the rule is active.
Posts: 389
@Absolute URLs in baseFile: I've poked around with this and made the .htaccess file accept these. The rules looks something like this:
RewriteRule ^v/(.+)$ http://example.com/drupal/gallery?g2_view=core:ShowItem&g2_path=$1 [QSA,L]
This works, but I dont like it. Since this'll redirect to non-local adress it wont quetly redirect, instead you'll be seeing http://example.com/drupal/gallery?g2_view=core:ShowItem&g2_path=album/image.jpg.html in the path bar of you browser. This is probably not wat you want - since you get the long format.
The bottom line is; it'll work - but wont be beautiful.