URL not quite right in WP sidebar items
Arj
Joined: 2009-04-13
Posts: 5 |
Posted: Mon, 2009-04-13 15:19 |
Howdy all Excellent plugin. Everything is running well apart from one niggle. At the moment all the URLs created by the WPG2 sidebar blocks (Random Image / Album tree etc.) are generating the incorrect URL. Instead of generating http://example.com/gallery/v/album-name/ it is generating http://example.com/v/album-name/ For some reason it isn't inserting the "gallery" path into the URL. Although the URL works without the /gallery/ bit the URL gets changed to http://example.com/gallery/main.php?g2_path=album-name . This is bad for two reasons. First it is ugly and secondly it is giving the same page two different URLs which search engines don't like. Is it possible to make a few changes so that the '/gallery' path is included in the URL? If so what do I need to change. I am not familiar with php and from what I can tell the plugin is using the GalleryUrlGenerator so I am not sure what to do. I am running with the wordpress installation (2.7.1) in the domain root. Cheers Arj |
|
Posts: 27300
Did you activate the rewrite rules though WPG2, not directly though gallery?
upgrade do to bugs and security issues.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 5
Yes, the mod_rewrites have been activated via the WPG2 "Gallery2 Rewrites" tab and all tests have passed.
Yup, understood but I want to get this working as a baseline first before I do an upgrade.
Here are my .htaccess files if it is any help:
Wordpress : http://www.pastie.org/pastes/445506
Gallery2 : http://pastie.org/445503
Arj
Posts: 27300
The only thing I can think of is to remove all the rules, test the behavior. Then add one rule at a time to see where the behavior changes to what you don't expect.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 5
Ok, I now have the /v/album-name working without being re-written but thinking about it, this is looking at the symptom rather than the cause. The .htaccess file is only changing the URL because the original URL output by wpg2 is incorrect because it doesn't have the path to the root of the gallery in it.
I would expect the '/gallery/' in all the wpg2 generated links in my site because that is where the gallery is installed.
I would expect '/gallery2/' in all the wpg2 generated links in your site because that is where it is installed.
That still means that the same page will have two links to it; one with /gallery/ (From within the gallery pages) and one without (From the WP pages) which doesn't do site crawlers any good.
Ideally I would like to fix the output of wpg2; unfortunately I am not a PHP developer and this looks beyond simple tinkering.
Arj
Posts: 27300
I am not a expert but you can force embedded urls:
config.php
$gallery->setConfig('mode.embed.only', false);
change to true.Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 5
No, good idea, I can see where you are going with it but all that does is restrict access to the gallery, the 'url' option isn't what is needed either since it static.
While I as in there I also tried setting $gallery->setConfig('baseUri', '/gallery/'); or $gallery->setConfig('baseUri', 'http://www.fqdn.com/gallery/'); to see if that would force the output of wpg2 to change but nothing seemed to affect it.
What I need is wpg2 to output the correct path prefixed URL (Would be happy with just a "Replace the following line in file A with X", I have a feeling it could be a one-line change); failing that, as a worst case scenario I use apache's mod_alias to setup permanent redirects to the correct /gallery/ location.
Naturally I would prefer the former option but needs must.
Arj
Posts: 244
Hi Arj,
I am using nearly the same system as you.
Did you checked your settings for WPG2 at "WPG2 Paths" in the Dashboard?
Here are my settings:
=> gallery2 url: http://example.com/gallery/
=> url to wpg2 output: http://example.com/gallery/main.php
=> gallery2 file path: /absolute/path/to/your/gallery/ (e.g./var/www/gallery/
Hope this helps.
Cheers,
Jens
___________________________________
http://jekophoto.eu | http://jekophoto.de
Posts: 5
Ahoi Jens.
I have ALMOST identical settings to you. The only difference is the "URL to WPG2 Output" which is the same as the gallery2 url.
=> gallery2 url: http://example.com/gallery/
=> url to wpg2 output: http://example.com/gallery
As you can see I am missing the trailing slash and the main.php. Unfortunately I cannot change this particular setting. The input box is greyed out. (I am logged in as an admin user) so not sure what to do next.
Posts: 244
Hi Arj,
I think this does not matter anything.
The next I would try is to change your .htaccess for wp:
From my point of view you can delete lines 1-34. This is what my .htaccess looks like. But ensure to make a backup of your existing one before ;-)
If this is successful you should change the permissions to read-only for the webserver. Elsewhere wp is able to change the settings back...
If this test is not successful, you could delete lines 26-34 - they are twice in your .htaccess.
Cheers,
Jens
___________________________________
http://jekophoto.eu | http://jekophoto.de