Gallery2 and SEO - Tips and suggestions

netscan

Joined: 2005-07-16
Posts: 39
Posted: Tue, 2007-02-13 02:18
ichthyous wrote:
Quote:
Do you really think that there is an issue with duplicate content & slideshows?

Yes, these days Google is very touchy about dupe content so why risk it? Flash slideshows are much prettier and no dupe content issues at all. Once you start seeing a good number of pages going supplemental it's very hard and time consuming to track it and turn it around.

Netscan, I'm not sure I really follow your last post. I don't have any main.php/index.php redirect as I have swapped the files. I did a lot of editing in one of the class files to remove the index.php entirely from my links. All of my internal links point to just the domain name.

New York City Photos by Andrew Prokos
Washington DC Photos by Andrew Prokos

If you've hand edited the class files and it works, cool, but updating gallery will be a pain because you will pretty much have to do it all over. Using main.php as the default works just as good and you won't have to worry about upgrades mucking it up.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-02-13 14:02

i guess a simple way to get rid of main.php / index.php is:

- set your webserver's directory index to main.php (Apache DirectoryIndex main.php index.php index.html index.htm)
- set baseUri in config.php to 'http://example.com/gallery2/'

didn't test this, but i guess it should work.
i guess index.php / main.php should occur anywhere after this change.

------
if you just want to get rid of main.php in all urls and have index.php instead:
- you can use define('GALLERY_MAIN_PHP', 'index.php'); in your config.php,
- delete index.php
- rename main.php to index.php

and yes, you need to delete index.php and rename main.php to index.php after each g2 upgrade. but that's about it.

--------------
Enter the Gallery 2 Theme Contest today!

 
dmc43

Joined: 2005-02-16
Posts: 59
Posted: Fri, 2007-02-23 04:19

"i guess a simple way to get rid of main.php / index.php is:

- set your webserver's directory index to main.php (Apache DirectoryIndex main.php index.php index.html index.htm)
- set baseUri in config.php to 'http://example.com/gallery2/'

didn't test this, but i guess it should work.
i guess index.php / main.php should occur anywhere after this change."

Thanks valiant, that works for me. No index.php or main.php when navigating site.
The only bug? ( not really a problem ) is that when on any other page of the album, clicking the first link in the breadcrumbs returns me to the main page, whereas before I would be directed to the page I was on. If that makes sense to you.

Thanks again
www.roofersreview.com

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Sat, 2007-04-14 18:12

"i guess a simple way to get rid of main.php / index.php is:

- set your webserver's directory index to main.php (Apache DirectoryIndex main.php index.php index.html index.htm)
- set baseUri in config.php to 'http://example.com/gallery2/'

didn't test this, but i guess it should work.
i guess index.php / main.php should occur anywhere after this change."

~~@~~@~~

when you are talking about the webserver's directory index, are you also talking about the .htaccess file?

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Sat, 2007-04-14 18:49

or you may be talking about a redirect?

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2007-04-14 18:55

sambritt
He means the webserver's directory index as set in the server's configuration file. You will not have access to this file on normal shared hosted sites.
.
Gallery Version: 2.2.1
Gallery Theme: PGTheme 1.1.0 (RC01)
Web Site: http://dakanji.com

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Sat, 2007-04-14 19:43

is there any other way to get completely rid of the /main.php in the URL as well as the /index.php?

thank you

 
netscan

Joined: 2005-07-16
Posts: 39
Posted: Sat, 2007-04-14 20:51
sambritt wrote:
is there any other way to get completely rid of the /main.php in the URL as well as the /index.php?

thank you

Have you tried the suggetions above?

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Sun, 2007-04-15 22:11

No because there is only one way mentioned to completly get rid of it vs. just changing the main.php to index.php.

this main.php pointing needs to be an easy type thing to change in the admin panel.

Updating from the G1 to the G2 is an easy process to conquer, BUT i hate the fact that all my SEO URL's are now wasted and gone that have been pointing from other 3rd parties web sites going on 3-4 years now. This is a NightMare for an SEO/Internet Marketing Freak like me. Next time I will install this on another URL and I guess I should have known better to begin with.

My permnalinks are all showing in the G2 Admin panel, but cant figure out the .htaccess file to work properly. this main.php file in the URL is driving me crazy to look at and I cant get rid of it...

:(

 
netscan

Joined: 2005-07-16
Posts: 39
Posted: Sun, 2007-04-15 22:23

Ok, let me break it down a bit here so I can follow where exacty you are

You do not have the ability to add main.php to the DirectoryIndex directive in httpd.conf, right?

Assuming the above is true, have you tried adding $gallery->setConfig('baseUri', '/'); to config.php and renaming main.php to index.php?

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Mon, 2007-04-16 01:11

Yes, I'm assuming that I do not have the ability to add main.php to the DirectoryIndex directive in httpd.conf.

I'm on a shared hosting with startlogic and now I have tried adding, $gallery->setConfig('baseUri', '/'); to config.php and renaming main.php to index.php.

the URL is good but the theme is not working now, so now I'll log on the admin and try changing themes to see if that works.

thank you very much for your support netscan...

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Mon, 2007-04-16 01:14

hmmm, now when i click on the log on link, it goes to my home index page. In fact all my links now are just going to the home index page, one up from the sub directory of the gallery location.

 
netscan

Joined: 2005-07-16
Posts: 39
Posted: Mon, 2007-04-16 01:30

set the baseUir in config.php to your gallery root directory

ie: if it's http:://yoursite.com/gallery/ == $gallery->setConfig('baseUri', '/gallery/');

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Mon, 2007-04-16 01:53

it seems to like the code a little better of: $gallery->setConfig('baseUri', '');

but not @ 100% as the images are not showing @ all

thanks again for your support, SB

 
netscan

Joined: 2005-07-16
Posts: 39
Posted: Mon, 2007-04-16 02:07

It's not showing images because it's looking in the wrong place - right click on one and grab the properties and you'll see what I mean.

You have to set the baseUri to the correct location (the folder where gallery resides)

/ == yoursite.com/
/gallery/ == yoursite.com/gallery/

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Mon, 2007-04-16 03:43

Thank You, Thank You, Thank You, your the best netscan!!! :)

it works,

the example above will totally delete the main.php in the URL and not replace it with the index.php in the URL.

thank you for your patience here...

~~@~~@~~

may i ask another question about the URL coding here, or should i go somewhere else?

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Mon, 2007-04-16 04:17

everyting still works but now when i click on either the site admin or your album links, they go to an error page. also all the links to any of the image galleries are not working.

can you please explain? thank you.

 
netscan

Joined: 2005-07-16
Posts: 39
Posted: Mon, 2007-04-16 10:08

Check .htaccess, see if any of the rules are pointing to main.php

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Mon, 2007-04-16 16:35

do you have a code for the .htaccess as now it says

# BEGIN Url Rewrite section
# (Automatically generated. Do not edit this section)
<IfModule mod_rewrite.c>
RewriteEngine On

# The path to your Gallery (in this case example.com/gallery2/)
RewriteBase /gallery2/

RewriteRule ^admin /gallery2/main.php?g2_view=core.SiteAdmin [QSA,L]
</IfModule>
# END Url Rewrite section

 
netscan

Joined: 2005-07-16
Posts: 39
Posted: Mon, 2007-04-16 21:10
<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} !/main\.php$
    RewriteRule .   -   [L]


      RewriteCond %{QUERY_STRING} view=core.DownloadItem
      RewriteCond %{QUERY_STRING} itemId=([0-9]+)
        RewriteCond %{HTTP_REFERER} !://yoursite.com/ [NC]
        RewriteCond %{HTTP_REFERER} !^$
      RewriteRule .   /main.php?g2_view=watermark.DownloadItem&g2_itemId=%1   [L]

    RewriteCond %{THE_REQUEST} \ /updates/(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=updates.ShowUpdates   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /Key-Word/view/([0-9]+).html(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=comment.ShowAllComments&g2_itemId=%1   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /Key-Word/add/([0-9]+).html(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=comment.AddComment&g2_itemId=%1   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /Key-Word/([0-9]+)-([0-9]+)/([^\/\?]+)(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]

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

    RewriteCond %{THE_REQUEST} \ /([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=rewrite.FileNotFound   [QSA,L]

</IfModule>

I have my server set to display main.php as an index page though.

What you can do is change your's to read index.php instead of main.php but I don't know how it will affect gallery since they made main.php hard coded in a lot of crap (they might have changed that too though since last I checked), you will at least be able to get in and configure the rewrite module correctly.

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Tue, 2007-04-17 18:25

nnaaawww, since i have used this gellery installer of about 1000 times it seems like, (thank god it keeps using the same sql tables)

i am in frY mode with this... this G2 has completly ~!@#$% my URL database and four years worth of links pointing.

I actually have page ranks on some of these URL's and WHAM!!!, they are worthless in amount of seconds, that took years to development. Now my webmasters account with Google is Smoking with issues!!!!!

you have to be completly MAD !!!! not to think of this !!!!

DO NOT UNDER ANY CIRCUMSTANCES UPDATE FROM G1 TO THE G2 IF YOU HAVE URLs POINTING TO YOUR WEB SITE.

UNLESS YOUR An .HTACCESS GURU AND YOUR NOT A NOVICE LIKE I AM.....

did you know WordPress automatically gives you the .htaccess codes in their PERMALINKS Section??????

i want to put the G1 back and install G2 on another directory. maybe i can task this one in 30 days, like it has taking me hours of beyond reason by now. :(

 
netscan

Joined: 2005-07-16
Posts: 39
Posted: Tue, 2007-04-17 23:17

I'm pretty sure G2 has a rewrite rule built into the module for G1 installs, prolly take awhile to make sure it's exactly right.

And for the love of god man - work on a copy of your gallery until you get it straight before taking it live.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-04-19 14:27

netscan

thanks for supporting sambritt and many other users!

sambritt

as jojotop points out, you can rename main.php to index.php, but you have to tell g2 about it by changing the GALLERY_MAIN_PHP constant as explained in the FAQ entry linked above.
once that's done, you need to tell g2 to write .htaccess again, overwriting the rules with new ones based on index.php.
go to site admin -> url rewrite: save. then check your .htaccess. it should have index.php where it had main.php before.

Additionally, set your baseUri in config.php to /gallery/ (the value you guys determined above) and you should be all set.

> DO NOT UNDER ANY CIRCUMSTANCES UPDATE FROM G1 TO THE G2 IF YOU HAVE URLs POINTING TO YOUR WEB SITE.

I understand your frustration but G1 URLs still work in G2 if you follow the instructions. All G1 image and photo/album page urls are redirected (permanentely) to G2.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Edi2
Edi2's picture

Joined: 2007-04-27
Posts: 8
Posted: Fri, 2007-04-27 11:10

Thanks to netscan for this useful post.

I installed for the first time gallery on my site and trying to apply this :
"==HighlightId==

Open modules/core/templates/blocks/BreadCrumb.tpl

Remove arg3="highlightId=`$theme.parents[parent.index_next].id`"

and

Remove "arg3="highlightId=`$theme.item.id`"
"

However, in my BreadCrumb.tpl file I can not find these lines :-(

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Fri, 2007-05-25 17:40
Edi2 wrote:
I installed for the first time gallery on my site and trying to apply this :
"==HighlightId==

Open modules/core/templates/blocks/BreadCrumb.tpl

Remove arg3="highlightId=`$theme.parents[parent.index_next].id`"

and

Remove "arg3="highlightId=`$theme.item.id`"
"

However, in my BreadCrumb.tpl file I can not find these lines :-(

So do I...
ver. G2.2
Can anybody help, where the new location of the above code is?
:|

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2007-05-26 16:09

Those lines of code were taken out of BreadCrumb.tpl on August 1st, 2006.

Read through this post, http://gallery.menalto.com/node/54753 This appears to be what you're looking for. Bharat also points out some of the functionality you loose by doing this.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Sat, 2007-05-26 16:47

Thanks, nivekiam!

I see...

I have have fixed this, but forgot to write it here.
Somewhere in the forum I have found a post describing how to modify G2.2

I think it was in: modules/core/classes/GalleryUrlGenerator.class

So I have modified also: modules/core/templates/blocks/BreadCrumb.tpl

I've made some tune to the carbon template, some links become rel="nofollow" and now everything seems to work how I've wanted:
http://dichev.com/gallery/

Hope it's enough SE friendly now.

If somebody is interested in details I can explain it when I find some time.
So write here if you have a question.

Thanks again and good luck to everybody.
This script is amazing!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2007-05-26 17:25

Again, just be aware that you loose some functionality and usability with this modification, so you have to decide is being slightly more SE friendly is worth making your gallery harder to navigate around in.

Also, for those reading this thread, please read the entire thread here http://gallery.menalto.com/node/54753 that explains what to edit. I'm with ichthyous here that Google is smart enough to not be effected by what appears to be "duplicate" content.

I've had some Ubuntu screenshots on my Gallery for a long time now, using Gallery just as it is out of the box with little to no modification:
http://www.google.com/search?q=Ubuntu+Inustalled+Under+VMware&hl=en&filter=0

I don't see where google thinks anything there is duplicate content.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Sat, 2007-05-26 22:49

You have the right, nivekiam.
I've got your point, but in my case this is good enough for me.

I have read that some of the functionality will be lost and I see that in multipage albums the gallery will be less user friendly.

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Mon, 2007-05-28 18:11

nivekiam,
after all I think, that Google is not smart enough to recognize this as one page..
It thinks all of these URLs are different pages, even in my case they all have refered to one (same) page. Please, correct me if I am wrong.

dichev.com/gallery/albums/kavala/?g2_highlightId=101 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=107 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=113 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=116 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=154 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=160 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=163 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=169 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=175 404 (Not found) [?] May 26, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=178 404 (Not found) [?] May 25, 2007
dichev.com/gallery/albums/kavala/?g2_highlightId=181 404 (Not found) [?] May 26, 2007

p.s. - I've removed the http-prefix, not to spam the forums with links.

-----
See my Gallery2 at: http://dichev.com/gallery/

 
honvl

Joined: 2007-04-26
Posts: 17
Posted: Wed, 2007-07-11 02:41

User-agent: *
Disallow: /gallery/c/
Disallow: /gallery/d/
Disallow: /gallery/srss/
Disallow: /gallery/rss

User-agent: Googlebot
Disallow: /gallery/*?*

I recently had my main gallery pages go supplemental in Google's index, so I am blocking all dynamically generated pages with this robots.txt code.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2007-07-13 15:51
honvl wrote:

I recently had my main gallery pages go supplemental in Google's index, so I am blocking all dynamically generated pages with this robots.txt code.

That is extreme and will not solve your issue. You need to block selected urls. Slideshow for instance can be a problem.
Have a look at

User-Agent: *
Disallow: /gallery/main.php?g2_view=core.UserAdmin* >>This blocks login page
Disallow: /gallery/main.php?g2_view=comment* >> This blocks comments
Disallow: /gallery/*slideshow.html* >> Blocks Slideshow pages...slideshow is a major prob
Disallow: /gallery/c/* >> can even remember what this blocks
Disallow: /gallery/key/* >> Keyword albums
Disallow: /gallery/popular* >> Popular images albums
Disallow: /gallery/admin* >> all admin pages
Disallow: /gallery/srss/ >> rss
Disallow: /gallery/rss >> rss

Browse thorugh your site and pick pages you don't mean GBot to index and paste wildcard versions of the links to your robots file. I just wanted mine to focus on the images and nothing more.
.
Gallery version = 2.2.2 core 1.2.0.4
PHP version = 4.3.9
Operating system = Linux (CentOS 4)
Default theme = PGtheme
Web Site: dakanji.com

 
honvl

Joined: 2007-04-26
Posts: 17
Posted: Sat, 2007-07-14 01:50

You are right, it was extreme. Gallery appended dynamic data to the Googlebot session, and as a result even non-dynamic photo pages were cleared off the Google index. I am going to try this configuration in my robots file.

User-agent: *
Disallow: /gallery/main.php?g2_view=core.UserAdmin*
Disallow: /gallery/main.php?g2_view=comment*
Disallow: /gallery/*slideshow.html*
Disallow: /gallery/c/*
Disallow: /gallery/key/*
Disallow: /gallery/popular?*g2_page* >> blocks the popular album beyond the first page
Disallow: /gallery/updates?*g2_page* >> blocks the updates album beyond the first page
Disallow: /gallery/index.php?*g2_rating* >> blocks rating stars
Disallow: /gallery/admin*
Disallow: /gallery/srss/
Disallow: /gallery/rss

 
cimbus

Joined: 2007-07-02
Posts: 11
Posted: Tue, 2007-07-17 20:44

DUPLICATE CONTENT (photo resize)
to avoid this just put these simple lines to the head section of your theme.tpl
{if $theme.imageViewsIndex==1}
<meta name="robots" content="noindex,nofollow"/>
{/if}
The site with the dupl. cont. is not indexed by robots this way.
A more user friendly version is just put (to the head) the line {include file="gallery:mycustomfolder/head_include.php"} and write into the head_include.php anything you like make appear in the html head section.

ROBOTS
the dynam. robots.txt is nice solution but will never solve the basic problem that the worst of all the crawlers will just ignore the robots.txt and the disallow paths. The best way I know (against these bad guys) is also by php:
$find_BaiDu = 'BaiDu'; //BaiDuSpider ban
$pos = strpos($agent, $find_BaiDu);
if ($pos === false):;
else: echo 'Sorry!'; exit; endif;
This should be put to the top of the main site just before anything. Similar solutions you get with .htaccess also.

 
Richard King

Joined: 2007-07-08
Posts: 24
Posted: Sat, 2007-08-04 20:59

There is a much easier way to improve SEO

Use gallery as part of a text rich website, not as the whole website!

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Sat, 2007-08-04 21:26

Yes, it is very good idea to use G2 as a part of a website, so do I, but Gallery2 is advanced enough to handle rich text content to every image or album page. It is a personal decision how to build your website architecture and depends to the individual code & content writing skills.
-----
See my Gallery2 at: http://dichev.com/gallery/

 
sambritt
sambritt's picture

Joined: 2007-04-14
Posts: 28
Posted: Fri, 2007-08-31 03:43
netscan wrote:
<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} !/main\.php$
    RewriteRule .   -   [L]


      RewriteCond %{QUERY_STRING} view=core.DownloadItem
      RewriteCond %{QUERY_STRING} itemId=([0-9]+)
        RewriteCond %{HTTP_REFERER} !://yoursite.com/ [NC]
        RewriteCond %{HTTP_REFERER} !^$
      RewriteRule .   /main.php?g2_view=watermark.DownloadItem&g2_itemId=%1   [L]

    RewriteCond %{THE_REQUEST} \ /updates/(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=updates.ShowUpdates   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /Key-Word/view/([0-9]+).html(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=comment.ShowAllComments&g2_itemId=%1   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /Key-Word/add/([0-9]+).html(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=comment.AddComment&g2_itemId=%1   [QSA,L]

    RewriteCond %{THE_REQUEST} \ /Key-Word/([0-9]+)-([0-9]+)/([^\/\?]+)(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]

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

    RewriteCond %{THE_REQUEST} \ /([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_FILENAME} !/main\.php$
    RewriteRule .   /main.php?g2_view=rewrite.FileNotFound   [QSA,L]

</IfModule>

I have my server set to display main.php as an index page though.

What you can do is change your's to read index.php instead of main.php but I don't know how it will affect gallery since they made main.php hard coded in a lot of crap (they might have changed that too though since last I checked), you will at least be able to get in and configure the rewrite module correctly.

I have everything working, the URL is pointing without the main.php showing and the permalinks are showing properly, BUT one thing. The images are not showing and when you click on the permalink, it shows as an error page.

Can anyone help? Thank you for your support, :)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2007-08-31 04:18

What's the error message? Can you share a link to your page? Can you turn debug mode on and post the output?

If the output it more than 30 lines or so, copy it into a text file and attach that to your post.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Fri, 2007-08-31 10:21

Please, note, that if replacing main.php with index.php, you may lose some important functionality and I am not sure, but some plugins may stop work. For example: the webservice for Windows XP upload and Gallery remote.

See my Gallery2 at: http://dichev.com/gallery/

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2007-08-31 16:33

I have not tested this, but for the PublishXP feature, you might be able to change the registry entry to get that working. Gallery Remote might involve more work if the GR client it hard coded to look for main.php instead of just using the URL provided, whether it's index.php, main.php or a directory
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Fri, 2007-08-31 17:27

I have already migrated to gallery/ instead of gallery/main.php more than a month ago as a result of some changes in the source, which unfortunately I do not remember. I will try to activate the functionality of Publish XP by modifying the registry file before importing it.

See my Gallery2 at: http://dichev.com/gallery/

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Sun, 2007-12-02 23:39

As to things you can do to add SEO to your Gallery2, you can try some of the things in the message, Thirteen Ways To Add SEO To Gallery2, at http://gallery.menalto.com/node/70008

Some of them have already been mentioned above, so some of the items in this thread are repeated, but I thought it would be good to centralize them into one list. If anyone has additions to suggest, I'd love to add more.

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.smjdesign.com/photos/

 
JST

Joined: 2008-01-02
Posts: 6
Posted: Thu, 2008-01-03 16:59

Try GalleryTheme.class

/**

if (!empty($theme['parents'][$i + 1]['id'])) {
$urlParams['highlightId'] = $theme['parents'][$i + 1]['id'];
} else if ($itemId && ($i + 1) == count($theme['parents'])) {
$urlParams['highlightId'] = $itemId;}

**/

Commenting this out worked for me. Found it somewhere here too!
--------
Thailand Portrait Photographer
Bangkok Thailand Photography
English Literacy Thailand

 
shahinfard
shahinfard's picture

Joined: 2008-11-18
Posts: 8
Posted: Tue, 2008-11-18 18:42

Hi,

I'm trying to remove the G2_Highlight variable appearing on the end of all Breadcrumb links. I can't find an "arg3="highlightId=`$theme.item.id"

Can you help?

File:

/gallery/modules/core/templates/blocks/local/BreadCrumbs.tpl

Quote:
{*
* $Revision: 15342 $
* If you want to customize this file, do not edit it directly since future upgrades
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
* version. Gallery will look for that file first and use it if it exists.
*}
{*
* Go through each breadcrumb and display it as a link.
*
* G2 uses the highlight id to figure out which page to draw when you follow the
* breadcrumbs back up the album tree. Don't make the last item a link.
*}
<div class="{$class}">
{foreach name=parent from=$theme.parents item=parent}
{if !$smarty.foreach.parent.last}
<a href="{g->url params=$parent.urlParams}" class="BreadCrumb-{counter name="BreadCrumb"}">
{$parent.title|markup:strip|default:$parent.pathComponent}</a>
{else}
<a href="{g->url params=$parent.urlParams}" class="BreadCrumb-{counter name="BreadCrumb"}">
{$parent.title|markup:strip|default:$parent.pathComponent}</a>
{/if}
{if isset($separator)} {$separator} {/if}
{/foreach}

{if ($theme.pageType == 'admin' || $theme.pageType == 'module')}
<a href="{g->url arg1="view=core.ShowItem"
arg2="itemId=`$theme.item.id`"}" class="BreadCrumb-{counter name="BreadCrumb"}">
{$theme.item.title|markup:strip|default:$theme.item.pathComponent}</a>
{else}
<span class="BreadCrumb-{counter name="BreadCrumb"}">
{$theme.item.title|markup:strip|default:$theme.item.pathComponent}</span>
{/if}
</div>

Thanks
Shah
http://www.teamgtr.com/gallery/

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Tue, 2008-11-18 19:02

@shahinfard

Read "9. Optimize permalinks" on my link two posts up:
Thirteen Ways To Add SEO To Gallery2

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.smjdesign.com/photos/

 
shahinfard
shahinfard's picture

Joined: 2008-11-18
Posts: 8
Posted: Tue, 2008-11-18 19:15

I did read that but I didn't understand what the post meant by

LINE 15 - BEFORE

LINE 15 - AFTER

Does it meant to copy that code before and after LINE 15 - or replace?

 
smjdesign
smjdesign's picture

Joined: 2007-02-26
Posts: 25
Posted: Tue, 2008-11-18 19:26

No, it's the state of the code. Before editing and after editing. You want to replace the before code with the after code.

--Stephen
http://www.smjdesign.com
Personal Photo Gallery
http://www.smjdesign.com/photos/

 
shahinfard
shahinfard's picture

Joined: 2008-11-18
Posts: 8
Posted: Tue, 2008-11-18 19:42

doh! I feel like a complete dumbo.. thank you - I'll have a go :)

 
shahinfard
shahinfard's picture

Joined: 2008-11-18
Posts: 8
Posted: Tue, 2008-11-18 20:02

You are the Don.. it worked thank you!

 
wideaware
wideaware's picture

Joined: 2006-06-21
Posts: 16
Posted: Mon, 2009-08-10 06:30

I have links to my gallery pointing to the folder, and rather than redirects, I chose to do this in the .htaccess

DirectoryIndex main.php index.php index.html
RewriteRule ^.*main\.php$ http://www.wide-aware.com/gallery/ [R=301,L]

Seems to be working fine.

=======
Outbound adventures and learnings for life!

Outdoor Adventure Photos