Everytime the menu router is rebuilt in Drupal, after adding modules, for example, the clean URL's in the Gallery2 turn to messy code. How do I prevent this? After I again run through the re-install process with the with the gallery module, it will works until the menu cache is cleared again. Earlier today the Gallery module reverted the theme to an different theme I install a while back and now the clean URL's have http://www.example.com/index.php/gallery/v/folder/?q=image.jpg while before it was the proper http://www.example.com/gallery/folder/photo.jpg. It's very messy and very scary since I want to go live with the site in a few weeks.

Comments

lvthunder’s picture

I think the problem is something is changing the .htaccess file. Get it to where it works then copy the .htaccess file and keep it in a safe place. Then if something happens just replace the file and it should start working again.

Adam S’s picture

It has to do with both gallery and drupal acting on the same .htaccess. To initially set up the clean URLs the user has to configure them in the independent standing Gallery2 site. www.example.com/gallery2 Then after the gallery module is installed into the drupal site and runs through the installation process it finds the gallery2 code in the .htaccess. It will run just fine until the menus are rebuilt or the clean URLs are reconfigured in the admin section of the embedded gallery2 within the Drupal site. While surfing through the embedded gallery at this point the URLs are messy and at the same time in the independent standing Gallery2 site they are clean and correct.

I also noticed that the clean URL configuration admin pages behave differently in the Galley2 site and the embedded gallery in Drupal. What I noticed was an option in the embedded gallery2 admin within the Drupal site to configure the path to the .htacces was empty and not visible in the free standing Gallery2 admin section. I filled this in with the correct information. For public access, although it suggested http://example.com/ I just put in a simple slash /. And I put the root directory in the other field /home/user/public_html. Everything is working perfect from then on. This form wasn't even visiable until the menu router was rebuilt. I'm sure I didn't read the instructions correctly and did ten times more work than I needed. Still it was wonderful learning for the first time how .htaccess file works smiling thinking about all the evil URLs I can manually create now.

But, if someone else has this problem. Here is the solution.

lvthunder’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.