James
Thanks for the alternative strategy using the plugin.
You're right - .htaccess is a black art known only to a select few
'Everything's weird and we're always in danger'
...involving sacrifices, long white robes and dancing over sheep's
entrails after dusk.
'It doesn't work that way'
However, a kind magician called Michael C Harris showed great
persistence and kindly provided the following solution which worked
fine for me (for my '/blog' subdirectory). And for all this - no
charge.
'You was a kindness when I was a stranger.'
### HABARI START
RewriteEngine On
RewriteRule ^(.+)/$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteBase /blog
RewriteRule . index.php [PT]
RewriteRule ^(system/(classes|locale|schema|$)) index.php [PT]
### HABARI END
Magic mushrooms can't mess with your brain, can they ?
--
Andy
On Jul 14, 3:41 am, James D <[email protected]> wrote:
> I had the exact same problem. After empirically proving that .htaccess
> is powered by magic, I took a look at the source to the DateYURL
> plugin. I was already using it anyway to make the rest of my URL line
> up, and adding a slash to the end of a URL involves modifying a single
> line of the plugin's PHP.
>
> I couldn't say *which* line off the top of my head, but it wasn't very
> hard to figure out.
>
> --James
>
> On Jun 28, 7:53 am, Andy C <[email protected]> wrote:
>
>
>
> > One of my punishments for outsourcing my comments to Disqus is
> > fragmentation of comments across two different URL's.
>
> > My preference would be to have no trailing slash on my post URL's e.g.
>
> >http://nbrightside.com/blog/2010/06/23/turbulence-ahead
>
> > I have a single entry in the database table 'habari__rewrite_rules'
> > which accomplishes this nicely (Thanks Michael)
>
> > parse_regex: %(?P<year>\d{4})/(?P<mon0>\d{2})/(?P<mday0>\d{2})/(?
> > P<slug>[^/]+)[/]{0,1}$%i
> > build_str: {$year}/{$mon0}/{$mday0}/{$slug}
>
> > I decided to install my blog in the 'blog' sub-directory
>
> > I have a top level '.htacess' containing a single line
>
> > Options +SymLinksIfOwnerMatch
>
> > My .htaccess in 'blog' contains
>
> > ### HABARI START
> > RewriteEngine On
> > RewriteCond %{REQUEST_FILENAME} !-f
> > RewriteCond %{REQUEST_FILENAME} !-d
> > RewriteBase /blog
> > RewriteRule . index.php [PT]
> > RewriteRule ^(system/(classes|locale|schema|$)) index.php [PT]
> > ### HABARI END
>
> > Disqus have introduced a consolidation feature where different comment
> > threads on what is the same post will be consildated as long as the
> > approrpiate 301 redirects are configured.
>
> > I thought I almost had success with this suggestion from Michael by
> > adding the following entry to 'blog/.htaccess'
>
> > RewriteRule ^(.+)/$ $1 [R=301,L]
>
> > This line was placed between 'RewriteBase /blog' and 'RewriteRule .
> > index.php [PT]'
>
> > However, when I try to reproduce this behaviour it seems this wasn't
> > wholly successful either as pages are displayed correctly. Initially,
> > I thought this worked for individual posts but broke the admin
> > dashboard but revisiting it, that doesn't seem to be the case.
>
> > So, to cut to the quick
>
> > What magic incantations do I need to add to '.htaccess' in order to
> > redirect
>
> >http://nbrightside.com/blog/2010/06/23/turbulence-ahead/
>
> > to
>
> >http://nbrightside.com/blog/2010/06/23/turbulence-ahead
>
> > Web Server: Apache 2.2.15
> > Habari: 0.7 (r4279)
> > MySQL
> > PHP 5.2.13
>
> > Thanks for ny help
> > --
> > Andy
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/habari-users