URL Rewrite Embedded Htaccess Question
majorheadache
Joined: 2004-04-22
Posts: 66 |
Posted: Thu, 2006-02-02 04:44 |
I have been able to successfully get the short URLs working on my test demo sites, but on my "real" site, I cannot. The problem comes under the Test tab, the 4th entry: "Embedded .htaccess file is up to date" always gives me an error. I have tried making sure that the .htaccess file in the standalone gallery2 folder is the same as the one in the modules folder where I enter the gallery, but this doesn't fix it. I think I may be misinterpretting what it wants. One major difference between my real site and the demo sites is that I have imported thousands of albums from G1.5. The import wizard says it has some 50,000 + entries. I'm not quite sure what to do with that, or how it's even supposed to work when it does work. What I imagined is that an old link to an album and/or an image could still work even though the old files are gone. But maybe 50,000 entries is too much of a resource hog to bother with it. Or maybe it doesn't work the way I think it does. Both my test sites and my real site are embedded into CPGNuke aka Dragonfly. Gallery URL: http://www.mlparena.com/index.php?name=gallery2 |
|
Posts: 66
Is there some reason this hasn't been replied to?
Is the answer painfully obvious? I did search, but I didn't find anything that answered this.
Is the question unclear? I'd be happy to add any missing details.
As an addendum, there is a link to "download htaccess file" (http://www.mlparena.com/gallery2/main.php?g2_view=migrate.Redirect) but instead of a download, I get what looks like the sourcecode to a page in Firefox, and in IE I get an empty gallery page.
I sure would appreciate any help I can get with this issue.
Posts: 32509
what error do you get?
Posts: 66
Well, when you are on the page the text is static and then thre is one of two responses: a green Success, or a red Error. I get the red one.
The entry looks like this:
[img]http://mlparena.com/forumpics/urlrewrite.gif[/img]
And to reiterate, I can create an identical site on a different domain, with the URL Rewrite setup the same way I set this one up and it works every time. I've done it 4 or 5 times at least.
Posts: 389
First, to make the test pass you need to go to the Rules tab and hit Save while in embedded mode (as you are on the screenshot above). The embedded .htaccess is not the same as the standalone one.
To make G1->G2 redirects work in embedded mode you might need to make two custom RewriteRules, depending on what your old G1 URLs looked like in embedded mode. Asssuming you had your G1 embedded too. I need an example G1 embedded album and item URL in order to help you out with that.
Posts: 66
Thanks for the reply.
On the First part, I did fill in the Rules tab, exactly as I did on the the sites which I was able to successfully accomplish this.
Let me see if my understanding of this is correct:
Standalone .htaccess file is the one that in is the gallery2 folder. I made that writeable to 666 so that gallery could modify it to it's liking.
Embedded .htaccess file is the one that in my case is in /modules/gallery2 (not the same gallery2 folder, as my gallery is installed in root) where my integration files are. This one is also CHMOD 666.
To me, the error message implies that these two files should be identical, and I have tried copying one to the other folder so that they ARE the same, but the error message persists.
There's also the old G1 embedded .htaccess file. I imagine there's one for the gallery install location, in my case /modules/gallery/ and maybe one for the albums location? Unfortunately I've deleted those so I don't have them handy. I can look at an old site backup, but since the backups are 10 gigs gzipped, this isn't an easy process.
I'm also not sure how it could be necessary for this to work since, on my test installs, I didn't have to do anything with G1 htaccess because they didn't exist.
Then there's the question of the 57,020 entries G2 says it has from the importation process. I suspect this is key, but I don't know what to do about it. It offers a link where I can download the .htaccess file, but as I said above, it doesn't work.
I'd be willing to give admin access if you think that would help.
Posts: 66
In an effort to get this resolved I finally deleted the 57,020 entries using the delete link on the G1 migration page. I double checked that both htaccess files in the gallery2 installation folder and the embedded modules/gallery2 integration folder.
Both look like this:
# BEGIN Url Rewrite section
# (Automatically generated. Do not edit this section)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_FILENAME} !index\.php\?name\=gallery2
RewriteRule . - [L]
</IfModule>
# END Url Rewrite section
I still get the same error. I really want to get the short URLs working... any ideas?
Posts: 389
The 57,020 entries you deleted was you G1->G2 URL mapping. Now only your G2 URLs will work, as opposed to having the old G1 URLs redirect to the new URLs.
The embedded .htaccess file should be in the directory where you CMS lies, if it is /cms/index.php then it's in /cms it should be. In your case you should have the .htaccess file in the root /. The standalone and embedded file should not be equal down to the very character of the file, but instead equal in the sence that they hold exactly the same rule configuration.
If you go to the Rules tab and hit save, both the embedded .htaccess and standalone will be written and when you have done that all test should pass.
In short:
1. Go to the Setup tab. Change the embedded htaccess location to you server root path and public path to "/". Hit Save.
2. Go to the test page - all test should pass.
Posts: 66
@the 57,020 entries, yeah I knew that but I was getting desperate and figured it might be the thing blocking the success. Oh well.
In my experience with the ones I have succeeded on, plus with my tinkering more last night, it looks for the embedded htaccess whereever the Embedded Setup path on the setup tab points to. I have made installs where the embedded path and the gallery location were one and the same, so it's comparing it to itself, and that works, on other sites. I even did that on this site to no avail.
In short:
1. I did that.
2. They don't.
If you're interested in figuring this out, we can. But maybe it's a moot point because the short urls are now working even though I can't get that one error to go away.
Posts: 389
@test, we're about to release g2.1rc1 soon (this week) and alot have changed since 2.0.2. In fact, most of the rewrite module has been rewritten and that test does no longer exist.
Posts: 66
OK thanks, I'll try not to think about it anymore. Do you happen to know if 2.1 addresses the speed issue when having too many user albums as mentioned in this post?
http://gallery.menalto.com/node/41459#comment-156302
Posts: 3
I thought I finaly found the answer to where to put this precious htaccess file but then I looked and I could not find a cms directory anywhere??
I am running 2.1 blackjack and have been trying to get this to work since yesterday...Please Please Please help.
Posts: 389
The cms directory is your Content Management System directory - the application you want to embedd Gallery into.
Also read the documentation on howto use rewrite and embeddng.
Posts: 3
This seems to still be broken in Gallery 2.1.2. I have it embedded in Drupal 4.7.3 and the gallery2 directory is next to the drupal-4.7.3 directory. The gallery .htaccess works fine but the test fails for the embedded .htaccess files. I noticed that there is already an .htaccess file (created by Drupal) so I did the chmod 666 on that one.
The htaccess path is:
/home/public_html/drupal-4.7.3
(this is how the path appears in the vdeck file manager so I am sure it is correct)
The public path is:
http://www.sitename.com/drupal-4.7.3
Anyone had luck yet?
Matt
Posts: 189
mharter -- many people have URL rewrite working in drupal 4.7/Gallery2, but it's not always easy. The .htaccess file that URL Rewrite needs is the drupal one. I have not had any problems once I point the htaccess path and public path to that. Is the test still failing?
Posts: 3
Solved!
The local file path shown in vdeck (I am using startlogic for hosting) is wrong. I looked in the error log to see if there were any references to local file paths in there and sure enough there were. Those references indicated that the proper file path is /home/username/public_html/ not /home/public_html as vdeck shows. The lesson here is not to trust vdeck absolutely (at least with startlogic). I would much prefer to have a hosting service that allows shell access so that I don't have to guess!
Thanks for your help though, I apreciate it.
Matt
Posts: 33
Im having a REALLY hard time trying to get this to work.
The Embedded htaccess is failing.
Where will the htaccess file be on the server?
This is my path to the gallery
/phpnuke/html/modules/gallery2/modules/
I dont have a htaccess file in the gallery2 directory nor the modules directory. If I create on and put it there, I get cant write to the file, I have chmod it to 777 and still isn't working. I'm totally lost on this part.
Can someone try to guide me?
Thanks a million
Running Nuke8.0, G2.1.2, Mod Rewrite 1.1.4
in case ya need to know
Posts: 33
I'm still having a problem with this.
I reinstalled everything and I now have the htaccess file in the gallery2 directory.
This is the directory
/nuke/modules/gallery2
The embedded htaccess file FAILED...
What do I enter in the htaccess path? Above listed?
I Chomod it to 666 and still tells me it can not write to it.
Any help would be appreciated.
Thanks
EDIT: OMG, I got it to work...after three days....boy oh boy..
Thanks to all
Posts: 2
I'm using Drupal 4.7x + Gallery 2 embedded. I cannot speak for other embedded installations, but for this Drupal + Gallery2 install, success only comes with making both of the following files writable.
success! hope that helps someone. thx,