Gallery module also called Gallery2 module: CleanURLs

Problem:
Ok so you did every thing right and you still can not get Clean URLs (URL rewrite module) to work with the embed of Gallery2.

Here is what finally worked for me:
1) Got to the "URL Rewrite Administration" within Drupal (embed), this is important as some additional embed specific fields will appear.
2) Go to the "Setup" tab and enter a value for "Htaccess path:" pointing to your Drupal install (ex on Windows:  E:\DomZeus\anciensducairecom\wwwroot), not to your G2 folder!

For "Public path:" I just put "/" (my Drupal root)

Additional step if you do not use a .htaccess with Drupal (like me).

3) The previous steps generate a .htaccess file (in the Drupal root). I pretty much copied the URL rewrite rules, from that .htaccess file, to my Apache configuration file where my current Drupal rules are.

Here is what these G2 rules look like:

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_FILENAME} !/index\.php$
RewriteRule . - [L]


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

Man oh man! Spent nearly all-day on this one....



Thanks for this fix! I'm just...

stuck on the last step. What file do i add the URL rewrite rules to? I'm not sure what file is my "Apache configuration file?"

Thanks in advance,
Scott

It really depends on your

It really depends on your Apache ".htaccess configuration". If ".htaccess support" is enable, most likely, the .htaccess file in your Gallery folder. It could also be the .htaccess at the web root of your site.
I personally disable .htaccess support and include all my .htaccess directives in the global Apache configuration file using an include statement. .htaccess directives in your global Apache configuration file are only loaded once versus at each file access.

If I see some interest in this I might write an article with more details.

Cheers,
C

Thank you, Thank you

Spent nearly all day trying to figure this out. It worked!

Gaurav Misra

Gallery URL Rewrite

THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!

Glad I could help...Snack !

Glad I could help, I still remember dealing with this issue for hours...

Cheers,
Christophe D.