rewrite not working properly?
robinbowes
Joined: 2002-09-20
Posts: 99 |
Posted: Sat, 2002-09-28 07:26 |
Hi, I've got (minor) problems using mod_rewrite with gallery. I'm not sure that gallery is working as I would expect it to (or I may be wrong!) At first, I had the trailing slash problem (as described here: http://gallery.menalto.com/modules.php?op=modload&name=phpBB_14&file=index&action=viewtopic&topic=411&6) which meant that rewriting was not detected by the configuration wizard. Changing the alias in httpd.conf fixed it: Alias /gallery /var/www/robinbowes.com/gallery I've re-run the configuration and re-write is now detected to be working correctly. I can use URLs in the form: http://robinbowes.com/gallery/Family-photos instead of http://robinbowes.com/gallery/view_album.php?set_albumName=Family-photos. However, and this is what I perceive to be the problem, Gallery is still generating links in the latter format, e.g. if I log in as Admin and go to the top level (http://robinbowes.com/gallery) the URL listed for the Family-photos album is http://robinbowes.com/gallery/view_album.php?set_albumName=Family-photos. rather than http://robinbowes.com/gallery/Family-photos . Is this normal behaviour, or am I correct to expect Gallery to generate urls in the short format when re-writing is enabled? Thanks, Robin |
|
Posts: 7994
I tried to check this out, but your entire site is reporting:
Let us know when that's fixed and we'll check out your rewrite problem.
Posts: 99
Aha,
You must have caught me mid-reconfiguration! :smile:
It should be OK now.
Thanks for looking.
R.
Posts: 7994
I just tried again and am still getting the same exact error. Perhaps it's because I'm not logged in to your site and am using a layout that you don't have installed?
Posts: 99
Hi again,
I *think* I've found the problem, and you're right, it was related to you not being logged in and a typo in my default theme.
It really should work now!
Cheers,
R.
Posts: 7994
Ah, ok the site works now. So, the key thing is that you're using the Geeklog mod. I'm not familiar with how that mod works, so I don't know whether it is going to interoperate properly with the URL rewrite code. This is probably one for the guys who wrote the Geeklog patch.
I see that your site is working properly at the moment, but it looks like you've got rewriting turned off.
Posts: 99
Hi,
The geeklog patch works in a similar fashion to the other "wrapped by" code. I don't *think* the rewrite code should be affected by being wrapped in geeklog, but I can't say for sure.
That's the problem! It's actually turned on. e.g. if you access http://robinbowes.com/gallery/Family-Album, it opens the album named "Family-Album".
However, the links generated use the verbose URL, e.g. http://robinbowes.com/gallery/view_album.php?set_albumName=Family-Album
(see my original post)
Any idea why this should be?
R.
Posts: 8194
Make sure in config.php the following directive is set to 1
$gallery->app->feature["rewrite"] = 1;
Gallery should then generate URLs that use mod_rewrite...
Posts: 99
I checked that - it is.
Following Bharat's mention of the geeklog embedding, I tried disabling the geeklog embedding code (i.e. just commenting the $GALLERY_EMBEDDED_INSIDE = "geeklog"; line in config.php.).
Guess what... re-writing works when gallery is not embedded inside geeklog.
So, it looks like it's a problem with the geeklog/gallery integration.
At least I've got something to go on now!
Cheers,
R.
Posts: 7994
The problem is that rewrite is on. So turn it off in your config.php:
$gallery->app->feature["rewrite"] = 0;
then Gallery will generate the long URLs and should work with Geeklog.
Posts: 99
Bharat,
I'm not sure you're quite understanding the problem.
Gallery is generating long URLs and is working with Geeklog, even with rewrite turned on.
Short URLs work fine, but Gallery is not generating them when embedded within Geeklog.
If I turn off the embedding, the short URLs are generated correctly.
Any idea why Gallery should think that rewrite is "Off" when embedded within Geeklog?
R.
Posts: 7994
Ah, I understand now.
The problem is that Gallery disables short URLs whenever it is embedded in anything. This is because I had a *Nuke bias when I wrote that code and Nuke prevents us from using short URLs. The folks who do the geeklog patch could remove this restriction in their next rev of the patch... Or you could modify the makeAlbumUrl() function in util.php:
change:
if (!$GALLERY_EMBEDDED_INSIDE && $gallery->app->feature["rewrite"]) {
to:
if ($gallery->app->feature["rewrite"]) {
Posts: 99
Bharat,
Thanks very much for staying with me on this! That sounds like it will fix the problem.
I'll make the changes tonight and let you know it it works.
Cheers,
R.
Posts: 99
He there,
I've just made the change you suggested and it works!
Gallery is now wrapped seamlessly inside Geeklog with Short URLs working perfectly!
Thanks again,
R.
Posts: 3
Excellent job..! That worked for my problem that may or may not be related to this thread. See my thread at http://gallery.menalto.com/modules.php?op=modload&name=phpBB_14&file=index&action=viewtopic&topic=4165
I think this may be something that the gallery/geeklog integration kit may like to know about, if they already don't. I couldn't find any info about my specific problem on the various geeklog forums, or this forum for that matter. I was just desperate enough to do a general search for "geeklog" in the troubleshooting forum on this site and read through every single article. I'm just glad that the info in this thread helped.
I hope this problem and solution make their way into the various READMEs or FAQs, if it hasen't already and I just missed it..
Well done and many thanks to bharat and robinbowes for sticking with this issue.
-bob