Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Short URLs
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
squirgle  
View profile  
 More options Nov 11 2009, 9:31 am
From: squirgle <p...@squirgle.net>
Date: Wed, 11 Nov 2009 06:31:44 -0800 (PST)
Local: Wed, Nov 11 2009 9:31 am
Subject: Short URLs
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.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Duckles  
View profile  
 More options Nov 11 2009, 9:47 am
From: Tony Duckles <t...@nynim.org>
Date: Wed, 11 Nov 2009 08:47:00 -0600
Subject: Re: [Sweetcron] Short URLs

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:

# Map /i/ -> /items/view/
RewriteCond %{REQUEST_URI} ^/i/[0-9]+$
RewriteRule /i/([0-9]+) /items/view/$1 [L]

-Tony


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
squirgle  
View profile  
 More options Nov 11 2009, 10:47 am
From: squirgle <p...@squirgle.net>
Date: Wed, 11 Nov 2009 07:47:07 -0800 (PST)
Local: Wed, Nov 11 2009 10:47 am
Subject: Re: Short URLs
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:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nlenoir  
View profile  
 More options Nov 12 2009, 3:55 pm
From: nlenoir <nlen...@gmail.com>
Date: Thu, 12 Nov 2009 12:55:11 -0800 (PST)
Local: Thurs, Nov 12 2009 3:55 pm
Subject: Re: Short URLs
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:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Jones  
View profile  
 More options Nov 12 2009, 6:24 pm
From: Paul Jones <p...@squirgle.net>
Date: Thu, 12 Nov 2009 15:24:03 -0800 (PST)
Local: Thurs, Nov 12 2009 6:24 pm
Subject: Re: Short URLs
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.

http://dl.dropbox.com/u/695089/sweetcron%20shortened.zip

Something to keep in mind is that it doesn't replace the permalinks in
the theme, you need to do that manually. I just used

<?php echo $this->config->item('base_url').'i/'.$item->get_id();?>

instead of

<?php echo $item->get_original_permalink();?>

On Nov 12, 8:55 pm, nlenoir <nlen...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Jones  
View profile  
 More options Nov 12 2009, 6:24 pm
From: Paul Jones <p...@squirgle.net>
Date: Thu, 12 Nov 2009 15:24:48 -0800 (PST)
Local: Thurs, Nov 12 2009 6:24 pm
Subject: Re: Short URLs
Sorry, that should be <?php echo $item->get_permalink();?> not <?php
echo $item->get_original_permalink();?>

On Nov 12, 11:24 pm, Paul Jones <p...@squirgle.net> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google