[pLog-svn] r3761 - plog/trunk

Oscar Renalias oscar at renalias.net
Fri Jul 21 14:46:21 GMT 2006


I'm running LT at http://localhost/trunk/, but am I really the only
one who has tried mod_rewrite URLs with LT not running in the server
root?

I will try making the "/" optional in the rule and see if it works better.

On 7/21/06, Jon Daley <plogworld at jon.limedaley.com> wrote:
>         You should leave the ^ there, otherwise urls might be matched
> wrong, the ^ tags it to start at the beginning of the URL, rather than
> matching it anywhere in the string.
>
>         I wonder if we could do ^/?([0-9]+... so the / would be matched
> optionally and work for everyone.
>
> On Fri, 21 Jul 2006, Oscar Renalias wrote:
>
> > Sorry, my mistake. It wasn't "/^..." but "^/..." For whatever reason
> > all URLs that were being processed by mod_rewrite were starting with
> > "/" and it the regular expressions were not matching. I didn't try
> > removing the "^" but I will later on.
> >
> > I am using Apache 1.3.33 as provided by Apple.
> >
> > On 7/21/06, Jon Daley <plogworld at jon.limedaley.com> wrote:
> >>         The /^ is wrong. I am not sure what that would do.  You added that
> >> to all rules, and all rules are working, and not being caught by
> >> error.php?
> >>         I wonder if it works the same on your system if you take out the
> >> first '^'?  Does it work if you change "/^" to "^/"?
> >>         I am not sure why the default wouldn't work for you, what version
> >> of apache are you using?
> >>
> >> On Fri, 21 Jul 2006, Oscar Renalias wrote:
> >>
> >> > Since I'm no expert in mod_rewrite, would anyone with more experience
> >> mind
> >> > taking a look at these?
> >> >
> >> > They seem to work fine, except that I had to prefix every rule with "/"
> >> (so
> >> > that "^([0-9]+)(_[^/]+)?$ index.php?blogId=$1 [L,NC]" becomes
> >> > "/^([0-9]+)(_[^/]+)?$ index.php?blogId=$1 [L,NC]") to get them to work in
> >> my
> >> > machine, but I did not dare commit that change because the previous
> >> version
> >> > did not have this forward slash character at the beginning of it. Does
> >> anyone
> >> > know why?
> >> >
> >> > On 20 Jul 2006, at 23:45, oscar at devel.lifetype.net wrote:
> >> >
> >> >> Author: oscar
> >> >> Date: 2006-07-20 20:45:34 +0000 (Thu, 20 Jul 2006)
> >> >> New Revision: 3761
> >> >>
> >> >> Modified:
> >> >>   plog/trunk/.htaccess
> >> >> Log:
> >> >> added a few rewrite rules so that mod_rewrite can parse paged URLs
> >> properly
> >> >>
> >> >>
> >> >> Modified: plog/trunk/.htaccess
> >> >> ===================================================================
> >> >> --- plog/trunk/.htaccess     2006-07-20 20:22:31 UTC (rev 3760)
> >> >> +++ plog/trunk/.htaccess     2006-07-20 20:45:34 UTC (rev 3761)
> >> >> @@ -10,26 +10,35 @@
> >> >> Options +FollowSymLinks
> >> >>
> >> >> <IfModule mod_rewrite.c>
> >> >> +
> >> >> RewriteEngine On
> >> >> RewriteBase /
> >> >>
> >> >> # Permalink to the blog entry (i.e.
> >> >> /1_userfoo/archive/3_title-foo-bar.html)
> >> >> RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]+)_[^.]+\.html$
> >> >> index.php?op=ViewArticle&blogId=$1&articleId=$2 [L,NC]
> >> >>
> >> >> -# Monthly archive (i.e. /1_userfoo/archive/200401.html)
> >> >> +# Monthly archive (i.e. /1_userfoo/archive/200401.html)
> >> >> RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{6})\.html$
> >> >> index.php?blogId=$1&Date=$2 [L,NC]
> >> >> +# Monthly archive (i.e. /1_userfoo/archive/200401.html) -- same as
> >> above
> >> >> but with paging included
> >> >> +RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{6})\.html/page/([0-9]+)$
> >> >> index.php?blogId=$1&Date=$2&page=$3 [L,NC]
> >> >>
> >> >> # Daily archive (i.e. /1_blogfoo/archive/20040101.html)
> >> >> RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{8})\.html$
> >> >> index.php?blogId=$1&Date=$2 [L,NC]
> >> >> +# Daily archive (i.e. /1_blogfoo/archive/20040101.html) -- same as
> >> above
> >> >> but with paging included
> >> >> +RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{8})\.html/page/([0-9]+)$
> >> >> index.php?blogId=$1&Date=$2&page=$3 [L,NC]
> >> >>
> >> >> # Album (i.e. /88_userfoo/albums/34_title-foo-bar.html)
> >> >> RewriteRule ^([0-9]+)_[^/]+/albums/([0-9]+)_[^.]+\.html$
> >> >> index.php?op=ViewAlbum&blogId=$1&albumId=$2 [L,NC]
> >> >> +# Album (i.e. /88_userfoo/albums/34_title-foo-bar.html) -- same as
> >> above
> >> >> but with paging included
> >> >> +RewriteRule ^([0-9]+)_[^/]+/albums/([0-9]+)_[^.]+\.html/page/([0-9]+)$
> >> >> index.php?op=ViewAlbum&blogId=$1&albumId=$2&page=$3 [L,NC]
> >> >>
> >> >> # Albums (i.e. /88_userfoo/albums/)
> >> >> RewriteRule ^([0-9]+)_[^/]+/albums/$
> >> >> index.php?op=ViewAlbum&blogId=$1&albumId=0 [L,NC]
> >> >>
> >> >> # Category view (i.e. /88_userfoo/categories/4_cat-foobar.html)
> >> >> RewriteRule ^([0-9]+)_[^/]+/categories/([0-9]+)_[^.]+\.html$
> >> >> index.php?blogId=$1&postCategoryId=$2 [L,NC]
> >> >> +# Category view (i.e. /88_userfoo/categories/4_cat-foobar.html) -- same
> >> as
> >> >> above but with paging included
> >> >> +RewriteRule
> >> ^([0-9]+)_[^/]+/categories/([0-9]+)_[^.]+\.html/page/([0-9]+)$
> >> >> index.php?blogId=$1&postCategoryId=$2&page=$3 [L,NC]
> >> >>
> >> >> # Category-Feeds (i.e. /3_userfoo/feeds/categories/2_category/atom)
> >> >> RewriteRule ^([0-9]+)_[^/]+/feeds/categories/([0-9]+)_[^.]+/(.*)$
> >> >> rss.php?blogId=$1&categoryId=$2&profile=$3 [L,NC]
> >> >> @@ -49,14 +58,13 @@
> >> >> # Download a resource (i.e. /88_userfoo/get/this-is-a-resource-name.pdf)
> >> >> RewriteRule ^([0-9]+)_[^/]+/get/(.+)$
> >> resserver.php?blogId=$1&resource=$2
> >> >> [L,NC]
> >> >>
> >> >> -# Static Pages (i.e /3_userfoo/demosites)
> >> >> -RewriteRule ^([0-9]+)_[^/]+/(.+)$
> >> index.php?op=Template&blogId=$1&show=$2
> >> >> [NC]
> >> >> -
> >> >> # A non-default blog (i.e. /88_userfoo)
> >> >> RewriteRule ^([0-9]+)(_[^/]+)?$ index.php?blogId=$1 [L,NC]
> >> >> +# A non-default blog (i.e. /88_userfoo) -- same as above but with
> >> paging
> >> >> included
> >> >> +RewriteRule ^([0-9]+)(_[^/]+)/page/([0-9]+)$
> >> index.php?blogId=$1&page=$3
> >> >> [L,NC]
> >> >>
> >> >> -# Daily archive (i.e. /1_userfoo/archive/20040101.html)
> >> >> -RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{8})\.html$
> >> >> index.php?blogId=$1&Date=$2 [L,NC]
> >> >> +# Static Pages (i.e /3_userfoo/demosites)
> >> >> +RewriteRule ^([0-9]+)_[^/]+/(.+)$
> >> index.php?op=Template&blogId=$1&show=$2
> >> >> [NC]
> >> >>
> >> >> </IfModule>
> >> >>
> >> >>
> >> >> _______________________________________________
> >> >> pLog-svn mailing list
> >> >> pLog-svn at devel.lifetype.net
> >> >> http://devel.lifetype.net/mailman/listinfo/plog-svn
> >> >>
> >> >
> >> > _______________________________________________
> >> > pLog-svn mailing list
> >> > pLog-svn at devel.lifetype.net
> >> > http://devel.lifetype.net/mailman/listinfo/plog-svn
> >>
> >> --
> >> Jon Daley
> >> http://jon.limedaley.com/
> >>
> >> What sane person could live in this world and not be crazy?
> >> -- Ursula LeGuin
> >> _______________________________________________
> >> pLog-svn mailing list
> >> pLog-svn at devel.lifetype.net
> >> http://devel.lifetype.net/mailman/listinfo/plog-svn
> >>
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://devel.lifetype.net/mailman/listinfo/plog-svn
> >
>
> --
> Jon Daley
> http://jon.limedaley.com/
>
> If breathing didn't come naturally, we wouldn't have time for it.
> -- Anne Marie
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>


More information about the pLog-svn mailing list