I'm trying to configure the url rewrite from within drupal (admin>settings>gallery). I've entered all the appropriate settings under "rules" but I get the error:
"Cannot write to the embedded .htaccess file, please create it"

But I've got .htaccess files in my domain root (which is where drupal is ) and in the gallery2 folder. These have 777 permissions just to make sure that's not the problem. Where should I put the file it wants me to create?

Comments

kiz_0987’s picture

The URL Rewrite .htaccess file should be written with "Save Configuration" is clicked in gallery.module. Is that what you were referring to, or to Gallery2 site admin page errors? If the former then the directory it is trying to write to should have been included in the error message.

jivyb’s picture

This was on the gallery.module admin under the advanced options where it logs you in as admin for the gallery. The only way I could get rid of it was to turn URL rewrites off in gallery2. I'll have to turn it back on and check the file location, but I don't think it was there. I'll get back to you when I've turned URL rewrites back on...

benjleroy’s picture

I finally got this to work after much head beating, in the EMBEDDED rewrite setup you must set the following options:

Administer>settings>Gallery scroll to common admin settings for gallery and click on rewrite setup.

set the path to your gallery2 HTaccess Path (for me /usr/local/apache2/htdocs/drupal/gallery2) but DO NOT add a trailing slash.

For public location it should have the basic location already shown (www.yoursite.com) you just need to add /gallery assuming that the public sees gallery2 at www.yoursite.com/gallery

Finally you may need to temporarily change the permissions on your .htaccess file in the gallery2 directory in order of your webserver to write to it. (Most times not necessary because the user that your webserver is running as most likley has write access already).

GN’s picture

This doesn't work for me.
I created a separate htaccess file for the embedded gallery, and tried placing it in a variety of directories (Gallery2/subdir, Drupalroot/subdir, etc.), but when I change any Gallery2 URL rewrite settings, these changes are recorded both in the Gallery2 htaccess and in the embedded htaccess files. In the standalone mode, Gallery2 works OK, but the embedded thing does not let me browse any albums -- with the default "v/%path%" URL rewrite setting, album links are wrong and lead to a 404 error; if I change it to "gallery/%path%", the links look like what they should be (siteURL/gallery/albumname -- it worked OK for Drupal 4.6), but clicking on any album still displays the main gallery page embedded in Drupal.
Using the root Drupal htaccess file for the embedded gallery does not help, either -- all Drupal links stop working at all.
Are there any other tricks I'm missing?

kiz_0987’s picture

Version: » 4.7.x-1.x-dev
Status: Active » Closed (fixed)

Details are in the wiki.