# Set some reasonable defaults for PHP. Most of these cannot be set
# inside the script itself. For hosts that don't have .htaccess
# support but do support per-dir php.ini files, these settings are
# mirrored in php.ini
#
<IfModule mod_php5.c>
php_flag short_open_tag On
php_flag magic_quotes_gpc Off
php_flag magic_quotes_sybase Off
php_flag magic_quotes_runtime Off
php_flag register_globals Off
php_flag session.auto_start Off
php_flag suhosin.session.encrypt Off
php_value upload_max_filesize 20M
php_value post_max_size 100M
</IfModule>
# Try to disable the parts of mod_security that interfere with the Flash uploader
#
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
# Increase security by uncommenting this block. It keeps browsers
# from seeing support files that they shouldn't have access to. We
# comment this out because Apache2 requires some minor configuration
# in order for you to use it. You must specify "AllowOverride Limit"
# in your Apache2 config file before you uncomment this block or
# you'll get an "Internal Server Error".
#
# <FilesMatch "(\.(class|fla|gitignore|inc|ini|sql|txt)|(README|LICENSE|.build_number))$">
# Order deny,allow
# Deny from all
# </FilesMatch>
# <FilesMatch "robots.txt">
# Order allow,deny
# Allow from all
# </FilesMatch>
# Improve performance by uncommenting this block. It tells the
# browser that your images don't change very often so it won't keep
# asking for them. If you get an error after uncommenting this, make
# sure you specify "AuthConfig Indexes" in your Apache config file.
#
# <IfModule mod_expires.c>
# ExpiresActive On
# # Cache all files for a month after access (A).
# ExpiresDefault A2678400
# # Do not cache dynamically generated pages.
# ExpiresByType text/html A1
# </IfModule>
# You can use the mod_rewrite Apache module to get rid of the
# "index.php" from your Gallery 3 urls. Uncomment the block below
# inside the <IfModule> ... </IfModule> lines and then edit the
# RewriteBase line to match your Gallery 3 URL.
#
# Here are some RewriteBase values:
# Gallery 3 URL RewriteBase line
# ============= ====================
# http://example.com/gallery3 RewriteBase /gallery3
# http://example.com/~bob/photos RewriteBase /~bob/photos
# http://gallery3.example.com/ RewriteBase /
#
# Then just use your Gallery 3 without the index.php in the url.
#
# NOTE: future upgrades of Gallery 3 will overwrite this file! If you
# want these changes to be persistent, talk to your system admin about
# putting this block into your Apache config files.
#
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
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]
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]
</IfModule>
Posts: 27300
This has been reported in the modules thread:
http://galleryproject.org/node/102534?page=1#comment-400687
Hopefully somebody with some Apache rewrite expertise can advise.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
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"
www.xeta.at
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.
Try adding
RewriteCond %{THE_REQUEST} !^(.*)?/admin/(.*)
after the 2nd line.If it doesn't work, post the full url of the page being redirected that should NOT be redirected.
Posts: 42
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.
www.xeta.at
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
Here is my complete htaccess:
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.
www.xeta.at
Posts: 1857
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.)
Posts: 42
@webcycos in addition to tempg advice, i think you have another problem with the order in the htaccess, the following line
should be moved to the end of the block furthermore the last version of the code for fixing pagination is:
Do you also go through the modification of the paginator.html.php?
www.xeta.at
Posts: 42
@webcyco
By chance I came on where your real problem lies, you must not use blanks in the name of the "Pages"
Symply try "About-Freaky" instead of "About Freaky" and i think it will work....
www.xeta.at
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.
Posts: 135
The SEO code needs to come before the default rewrite rules that ship with G3 - #G3 defaults# in the example below.
---
Gallery - 3.0.5
Theme - WindHack
Site - www.gfisk.com/gallery
Posts: 42
@hoysted: Have you tried my .htaccess?
www.xeta.at
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:
http://www.example.com/gallery/my_awesome_album
http://www.example.com/gallery/my_awesome_album?page=2
http://www.example.com/gallery/my_awesome_album?page=3
http://www.example.com/gallery/my_awesome_album/sweet_pic
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:
http://www.example.com/gallery/my_awesome_album/page/1
http://www.example.com/gallery/my_awesome_album/page/2
http://www.example.com/gallery/my_awesome_album/page/3
http://www.example.com/gallery/my_awesome_album/sweet_pic
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,
Shad
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?