Change background +
FoOlRulez
We know more about Evangelion.
blog
facebook
forum
Back in the day...
by gebakkenvis - Today at 07:28:06 pm
Cow moo yes no barko
by Guymam - Today at 05:01:44 pm
Question!
by GBolt - Today at 04:51:58 pm
Mekara bimu.
by gebakkenvis - Today at 10:25:00 am
Suicide Edition Contest
by jaara - Today at 08:40:31 am
More Motivation
by jaara - Today at 04:02:41 am
GUYS!
by Guymam - Yesterday at 07:27:30 pm
M's IRL picture!
by Guymam - Yesterday at 07:10:24 pm
unread
manga
download
novels
webirc
IRC
Become a FoOlRulez team member!
FoOlz.us and how to make YOURLS work with Nginx.
Posted: August 30, 2009 at 11:19 pm in FoOls/Randomness., Games/Informatics.. Tagged with: , , .
Written by woxxy - Bio:
The owner of this website, caretaker of the blog, unstoppable web developer, graphic editor and leader of the FoOlRulez scanlation team.

Twitter: http://twitter.com/woxxy

Sometimes I wonder… why do I do such things?

Well, honestly I am a megalomaniac, and all the most famous websites have an URL shortening service for their own service. Since (one day) FoOlRulez will be the biggest website evar, I thought… why not adding the short URL service early? Doing it was far harder than thinking of it.

You know, we aren’t using a LAMP (Linux-Apache-MySQL-PHP) server, but an Nginx powered server (LNMP sounds gay tho). This means most of the software needs some fix to work correctly, though it will work much faster. This means YOURLS, the software I intended to use, needed some fix as well.

For this fix, I had to find a solution, and I have found it here: 使用 Yourls 强化你的短网址系统 – Showfom’s Blog.
I have no idea what that URL says… but hey, I found the fix to make YOURLS work!

if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/([0-9a-z]+)/?$ /yourls-go.php?id=$1 last;
}

Gibberish? No this is the code you need to make it work in your Nginx installation! Paste it where you need it. If you don’t know how comment here and I’ll explain a bit further.

Anyway, this made everything work… a bit of styling of the homepage et voilà!

http://foolz.us

It works! I can’t believe it myself!

Let’s go a bit more indeep with YOURLS. This is a very complete script to make your own URL shortener, by:

I think they’re the same who made a few of the plugins I use in this WordPress blog (yeah they are). Anyway, this script is powerful enough to not leave you dry mouthed: you get an API to use the URL shortening service on your server from anywhere, the admin menu lets you control the tidbits you need (ok, most of the controls are via code, but it’s easily done with the explanations), the code has explanation for most of the lines – I in fact edited it to fit my needs better.

Best part of all, it comes with a WordPress plugin, that hooks to the shortening service and makes a short url for every post: even this one post has a shortening url. Then you get automatic submission of the post to Twitter after publishing. The button to submit to twitter on the top is my creation by using the functions (wordpress hooks) that YOURL for WordPress provides.

  • Recent forum topics:
    Back in the day...
    by gebakkenvis
    Today at 07:28:06 pm
    Cow moo yes no barko
    by Guymam
    Today at 05:01:44 pm
    Question!
    by GBolt
    Today at 04:51:58 pm

    18 Responses to “FoOlz.us and how to make YOURLS work with Nginx.”

    1. woxxy says:

      @gamerz @ozh Thanks for YOURLS =) “FoOlz.us and how to make YOURLS work with Nginx.” http://foolrulez.org/blog/2009/08/foolz-...

    2. scizzer12 says:

      I love it woxxy.
      Keep up the good work.

    3. Nyarth says:

      The URL you linked above says “Use your short-Yourls enhanced web-based system – Showfom’s Blog.” /google translated =P

      So this is basically like Tinyurl/bit.ly huh?

    4. muge says:

      Oh hey, this is pretty cool.
      Once the database “registers” a custom keyword, does it expire after a while?
      Or is it permanently stored?

    5. M says:

      What? DickensUrl wasn’t good enough for you?

      FoOls: http://dickensurl.com/bf68/*an immensely long url*

    6. M says:

      Oh, shoot, I broke the blog. Sorry D:

    7. No Comment says:

      This is pretty cool.

    8. Showfom says:

      Haha so you use Nginx, too. I love it~

    9. Tom says:

      Ok, I don’t know where to put the code above. Please help. Thanks!

    10. [...] the site for YOURLS there’s a link for nginx rewrites however it has 3 [...]

    11. Akif says:

      Yeah, I am about to learn how to manage my own database. Good work!

    Leave a Reply

    Twitter Users
    Enter your personal information in the form or sign in with your Twitter account by clicking the button below.

    FoOlRulez 2006-2010 Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
    All the manga featured in this website are property of their publishers. The translations are fanmade and meant to be a preview of material unavailable for western countries. Do not try to profit from this material. If you liked any of the manga you obtained here, consider buying the Japanese versions, or the local translation, where available. Thanks for your support.
    For any need, contact support@[this domain] and we'll get to you as soon as possible.