I've been playing around with sweetcron for a few days now and thought
it would be nice if I could have shorter urls for the items. I've got
sweetcron set up at http://pjon.es which is quite a short URL, and it
would be even shorter if items were at URLs like http://pjon.es/i/18 rather than http://pjon.es/items/view/18
I've figured out that htaccess is probably the best way to do this,
just match anything after /i/ and redirect it to /items/view/ but my
RegEx-fu is not as strong as I would like, so was wondering if anybody
had any tips, or another easier way to do this.
Using mod_rewrite seems like the best way to me too. Haven't tested this,
but I would guess you'd want to add something like this near the top of your
.htaccess file, before the normal Sweetcron rewrite rules:
On Wed, Nov 11, 2009 at 8:31 AM, squirgle <p...@squirgle.net> wrote:
> I've been playing around with sweetcron for a few days now and thought
> it would be nice if I could have shorter urls for the items. I've got
> sweetcron set up at http://pjon.es which is quite a short URL, and it
> would be even shorter if items were at URLs like http://pjon.es/i/18 > rather than http://pjon.es/items/view/18
> I've figured out that htaccess is probably the best way to do this,
> just match anything after /i/ and redirect it to /items/view/ but my
> RegEx-fu is not as strong as I would like, so was wondering if anybody
> had any tips, or another easier way to do this.
> Using mod_rewrite seems like the best way to me too. Haven't tested this,
> but I would guess you'd want to add something like this near the top of your
> .htaccess file, before the normal Sweetcron rewrite rules:
> On Wed, Nov 11, 2009 at 8:31 AM, squirgle <p...@squirgle.net> wrote:
> > I've been playing around with sweetcron for a few days now and thought
> > it would be nice if I could have shorter urls for the items. I've got
> > sweetcron set up athttp://pjon.eswhich is quite a short URL, and it
> > would be even shorter if items were at URLs likehttp://pjon.es/i/18 > > rather thanhttp://pjon.es/items/view/18
> > I've figured out that htaccess is probably the best way to do this,
> > just match anything after /i/ and redirect it to /items/view/ but my
> > RegEx-fu is not as strong as I would like, so was wondering if anybody
> > had any tips, or another easier way to do this.
> I've managed to get it working by adding /i/ to routes.php and
> creating my own controller (i.php) based on items.php.
> For future reference, I've posted up how I did it here:http://pjon.es/i/25
> On Nov 11, 2:47 pm, Tony Duckles <t...@nynim.org> wrote:
> > Using mod_rewrite seems like the best way to me too. Haven't tested this,
> > but I would guess you'd want to add something like this near the top of your
> > .htaccess file, before the normal Sweetcron rewrite rules:
> > On Wed, Nov 11, 2009 at 8:31 AM, squirgle <p...@squirgle.net> wrote:
> > > I've been playing around with sweetcron for a few days now and thought
> > > it would be nice if I could have shorter urls for the items. I've got
> > > sweetcron set up athttp://pjon.eswhichis quite a short URL, and it
> > > would be even shorter if items were at URLs likehttp://pjon.es/i/18 > > > rather thanhttp://pjon.es/items/view/18
> > > I've figured out that htaccess is probably the best way to do this,
> > > just match anything after /i/ and redirect it to /items/view/ but my
> > > RegEx-fu is not as strong as I would like, so was wondering if anybody
> > > had any tips, or another easier way to do this.
I've zipped up both the files direct from my install. I kept them in
their folder structure, so just upload them to your sweetcron root and
it should work.
> Thanks for sharing your tip but for me it doesn't work :(
> I modified routes.php and create my file but nothing... any idea ?
> Nicolas
> On 11 nov, 16:47, squirgle <p...@squirgle.net> wrote:
> > I've managed to get it working by adding /i/ to routes.php and
> > creating my own controller (i.php) based on items.php.
> > For future reference, I've posted up how I did it here:http://pjon.es/i/25
> > On Nov 11, 2:47 pm, Tony Duckles <t...@nynim.org> wrote:
> > > Using mod_rewrite seems like the best way to me too. Haven't tested this,
> > > but I would guess you'd want to add something like this near the top of your
> > > .htaccess file, before the normal Sweetcron rewrite rules:
> > > On Wed, Nov 11, 2009 at 8:31 AM, squirgle <p...@squirgle.net> wrote:
> > > > I've been playing around with sweetcron for a few days now and thought
> > > > it would be nice if I could have shorter urls for the items. I've got
> > > > sweetcron set up athttp://pjon.eswhichisquite a short URL, and it
> > > > would be even shorter if items were at URLs likehttp://pjon.es/i/18 > > > > rather thanhttp://pjon.es/items/view/18
> > > > I've figured out that htaccess is probably the best way to do this,
> > > > just match anything after /i/ and redirect it to /items/view/ but my
> > > > RegEx-fu is not as strong as I would like, so was wondering if anybody
> > > > had any tips, or another easier way to do this.
> I've zipped up both the files direct from my install. I kept them in
> their folder structure, so just upload them to your sweetcron root and
> it should work.
> On Nov 12, 8:55 pm, nlenoir <nlen...@gmail.com> wrote:
> > Thanks for sharing your tip but for me it doesn't work :(
> > I modified routes.php and create my file but nothing... any idea ?
> > Nicolas
> > On 11 nov, 16:47, squirgle <p...@squirgle.net> wrote:
> > > I've managed to get it working by adding /i/ to routes.php and
> > > creating my own controller (i.php) based on items.php.
> > > For future reference, I've posted up how I did it here:http://pjon.es/i/25
> > > On Nov 11, 2:47 pm, Tony Duckles <t...@nynim.org> wrote:
> > > > Using mod_rewrite seems like the best way to me too. Haven't tested this,
> > > > but I would guess you'd want to add something like this near the top of your
> > > > .htaccess file, before the normal Sweetcron rewrite rules:
> > > > On Wed, Nov 11, 2009 at 8:31 AM, squirgle <p...@squirgle.net> wrote:
> > > > > I've been playing around with sweetcron for a few days now and thought
> > > > > it would be nice if I could have shorter urls for the items. I've got
> > > > > sweetcron set up athttp://pjon.eswhichisquitea short URL, and it
> > > > > would be even shorter if items were at URLs likehttp://pjon.es/i/18 > > > > > rather thanhttp://pjon.es/items/view/18
> > > > > I've figured out that htaccess is probably the best way to do this,
> > > > > just match anything after /i/ and redirect it to /items/view/ but my
> > > > > RegEx-fu is not as strong as I would like, so was wondering if anybody
> > > > > had any tips, or another easier way to do this.