Gallery 3 SEO URL Optimization
webcyco
Joined: 2013-02-06
Posts: 1 |
![]() |
Hello friends, i have been trying since morning i am not able to solve this issue, i have searched and tried following links but still it is not working, may be i am not following order or something please check it and help me to resolve this issue. Links that i have searched http://forums.iis.net/t/1186418.aspx/1 And my website link which is not working And Here is my httaccess Code. I have copied my entire ht access file so that you can easily find out the mistake that i am doing. Quote:
# Set some reasonable defaults for PHP. Most of these cannot be set Please suggest/help. Thanks in advance |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
This has been reported in the modules thread: Dave |
|
xeta
Joined: 2011-11-24
Posts: 42 |
![]() |
I have also already asked the creator of the SEO Mod http://www.milesjcarter.co.uk/blog/photos-on-the-web/gallery-3-seo-part-perfect-url-scheme/#comment-14648 I tried to correct the problem from both sides, but I cannot resolve the problem neither by changing the pages module nor by editing the rewrite code. In my opinion this line causes the problem: RewriteRule ^(.*)page/([^/\.]+)/?$ $1?page=$2 [L] The other possibility would be to change the name of the "pages" to anything else like "blog" |
|
tempg
Joined: 2005-12-17
Posts: 1857 |
![]() |
I don't use the pages module, but I looked (briefly) at the link @floridave provided. Looks like it can be solved with a Cond. If it doesn't work, post the full url of the page being redirected that should NOT be redirected. |
|
xeta
Joined: 2011-11-24
Posts: 42 |
![]() |
Quote:
Try adding RewriteCond %{THE_REQUEST} !^(.*)?/admin/(.*) after the 2nd line. Thanks for this great hint! I will come back with another answer, but it seems that do the trick. I will do some more testing in the evening. |
|
xeta
Joined: 2011-11-24
Posts: 42 |
![]() |
I have tested it now and with the additional code everything is working. Thanks again for the help! I have added the Rewrite Cond after Quote:
#External Rewrite – fixes pagination# Here is my complete htaccess: Quote:
# Set some reasonable defaults for PHP. Most of these cannot be set But there is one diffrence to the problem of the threadstarter, my "Pages" were always accessible, but i was not able to edit them. webcycos problem is that the pages are not accessible from visitors. |
|
tempg
Joined: 2005-12-17
Posts: 1857 |
![]() |
xeta wrote:
webcycos problem is that the pages are not accessible from visitors. First, glad everything's working for you. For @webcycos: I'd need more info on the exact error (as it appears in the logs) to figure out what's happening. The only thing that stands out initially is that Gallery's default htaccess section should likely be last: <IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)page/([^/\.]+)/?$ $1?page=$2 [L]
RewriteCond %{THE_REQUEST} \?page=([0-9]+).*
RewriteRule (.*) $1/page/%1? [R=301,L]
RewriteRule (.*)/page/1 $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f #DELETE THIS LINE TOO (it's a duplicate)
RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
RewriteRule ^index.php/(.*) $1 [QSA,R,L]
</IfModule> (Also, you'll probably want to add the line I wrote for @xeta above.) |
|
xeta
Joined: 2011-11-24
Posts: 42 |
![]() |
@webcycos in addition to tempg advice, i think you have another problem with the order in the htaccess, the following line Quote:
RewriteRule (.*)/page/1$ $1 [R=301,L] should be moved to the end of the block furthermore the last version of the code for fixing pagination is: Quote:
RewriteRule ^(.*)page/([^/\.]+)/?$ $1?page=$2 [L] Do you also go through the modification of the paginator.html.php? |
|
xeta
Joined: 2011-11-24
Posts: 42 |
![]() |
@webcyco Symply try "About-Freaky" instead of "About Freaky" and i think it will work.... |
|
hoysted
Joined: 2013-02-23
Posts: 1 |
![]() |
I tried to correct the problem from both sides, but I cannot resolve the problem neither by changing the pages module nor by editing the rewrite code. |
|
snackmaster
![]()
Joined: 2005-11-20
Posts: 135 |
![]() |
The SEO code needs to come before the default rewrite rules that ship with G3 - #G3 defaults# in the example below. <IfModule mod_rewrite.c> #External Rewrite - fixes pagination - http://www.milesjcarter.co.uk/blog/photos-on-the-web/gallery-3-seo-part-perfect-url-scheme/# RewriteCond %{THE_REQUEST} \?page=([0-15]+).* RewriteRule (.*) $1/page/%1? [R=301,L] RewriteRule (.*)/page/1$ $1 [R=301,L] #Old Gallery redirects RewriteBase /gallery RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.jpg.html RewriteRule (.*)\.jpg.html$ /gallery/$1/ [L,R=301] #Internal Rewrite - fixes pagination# RewriteRule ^(.*)page/([^/\.]+)/?$ $1?page=$2 [L] #G3 defaults# Options +FollowSymLinks RewriteEngine On RewriteBase /gallery RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L] RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L] RewriteRule ^index.php/(.*) $1 [QSA,R,L] </IfModule>
--- |
|
xeta
Joined: 2011-11-24
Posts: 42 |
![]() |
@hoysted: Have you tried my .htaccess? |
|
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
Hi everyone, I've been working on pagination-related stuff for Gallery 3.1, stumbled across this, and wanted to share a thought... I'm unconvinced the pagination "fix" as described is a good idea. In fact, I suspect it could actually *harm* SEO. One of the main principles of SEO is this: drive everything to a canonical URL. This way, the URL's stats aren't diluted, maximizing its search potential. The pagination "fix" does the opposite. Example - by default, we have links like this: Each of the first three links points to essentially the same content, whereas the fourth is clearly different. While query strings get a bad rep in SEO land, they do have the advantage of making the first three URLs look more-or-less the same, which indicates that they *are* the same content. Using the pagination "fix", these become: Each of these four links looks completely distinct, and the stats for "my awesome album" get diluted and fall in search rankings. Is this a reasonable conclusion? Is there something I'm missing here? Separate topic: adding extra rel links to strongly reinforce what pagination does/doesn't mean is unequivocally good for SEO. I may add this in soon... Take care, |
|
tempg
Joined: 2005-12-17
Posts: 1857 |
![]() |
@shadlaws: It depends on how you use your gallery. I consider each page to be distinct: different photos, different titles, different captions, etc. I don't really allow search engine indexing, but, where I do, the "fix" works well and each page is distinct. The result: if a page shows up in the search results, you land on the page where that photo is (instead of whatever the first page may be). The rel links would work against this, too, no? |
|