Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-02 16:25:32

phual
Member
From: UK
Registered: 2008-02-19
Posts: 26
Website

htaccess - a final tweek to gallery integration

Thanks to some excellent changes to the Plogger gallery code in svn, integrating it into Textpattern is verging on. I’ll be putting more details of my experience once I have complete success, but I’m left with one final problem that I lack the knowledge of how to change… the rewrite rules in the .htaccess file!

I think it highly likely that the changes necessary should be fairly easy, but after some playing it’s become clear that I just can’t wrap my head around the syntax. Here are the cruft-free rewrite rules inserted into the .htaccess file by each program:

#BEGIN Textpattern
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /relative/web/path/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization}  !^$
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#END Textpattern
# BEGIN Plogger
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /plogger
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule ^.*$ http://mydomain.com%{REQUEST_URI}/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [S=2]
RewriteRule feed/$ plog-rss.php?path=%{REQUEST_URI} [L]
RewriteRule ^.*$ index.php?path=%{REQUEST_URI} [L]
</IfModule>
# END Plogger

The Plogger rewrite code changes this /ploggerpath/?level=album&id=1 into this /ploggerpath/collection1/gallery1/

The Textpattern rewrite code changes this /?s=section into this /section

If both programs are installed in the same base directory and the gallery is found in Textpattern section “gallery”, the unaltered url would be

/?s=gallery&level=album&id=1

How would I need to change the rewrite rule to get it to something more useful, such as

/gallery/collection1/gallery1

Stuart

Offline

Board footer

Powered by FluxBB