wordpressI run wordpress.com on my various blogs and on www.woollypigs.com/galleries I run Gallery3 to show my photos from our travels.

For some reason the bog standard set up of these two don’t seem to like each other on my host. So after a lot of searching and going around in circles and just trying, eg. random editing something in the .htaccess for the heck of it.

I either got an 500 error or the blank galleries page in wordpress. I ended up with this in the .htaccess in my root folder.

.htaccess in the root folder (www.woollypigs.com/) :

# Switch rewrite engine off in case this was installed under HostPay.
RewriteEngine Off

SetEnv DEFAULT_PHP_VERSION 5

DirectoryIndex index.cgi index.php index.html

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

With trying to set the “RewriteEngine Off” I managed to get to see the woollypigs.com/galleries, the wordpress page, still not the Gallery3 page I had hoped.

So I changed my .htaccess in the /galleries folder where Gallery 3.0.4 (I know I downloaded that version)

.htaccess in the galleries folder (www.woollypigs.com/galleries) :

# 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
#

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

# Try to disable the parts of mod_security that interfere with the
# Flash uploader
#

SecFilterEngine Off
SecFilterScanPOST Off

# 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”.
#
#
# Order deny,allow
# Deny from all
#

#
# Order allow,deny
# Allow from all
#

# 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.
#

ExpiresActive On
# Cache all files for a month after access (A).
ExpiresDefault A2678400
# Do not cache dynamically generated pages.
ExpiresByType text/html A1

# 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 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.
#

DirectoryIndex index.cgi index.php


Options +FollowSymLinks
RewriteEngine On
RewriteBase /galleries/
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]

This got the whole thing to work again o/

For some reason the WordPress SEO by Joost de Valk rewrote my root .htaccess and I then lost contact to my gallery3 install, error 500. While I was poking around I decided to upgrade from 3.0.3 to 3.0.4 which Gallery3 had told me to do. I tried adding the index.php/upgrader to the url and it said that I had successfully upgrades, but I still got the please update note.

Therefore I downloaded 3.0.4 and followed these steps : http://codex.gallery2.org/Gallery3:User_guide:Gallery3:Installing_and_upgrading#Upgrading even after that I still got the please update to 3.0.4. But hey wordpress blog and the gallery3 is working now, so therefore I can’t complain.