Tulisan Pertama

10/02/2009

Ini adalah tulisan pertamaku di blog berbahasa Indonesia ini. Kalau dipikir-pikir, nulis pakai bahasa Inggris itu pegel juga. Jadinya pengen sekali-kali nulis pake bahasa ibuku, Indonesia.

Selamat datang…!!

CodeIgniter: Removing index.php

06/02/2009

CodeIgniter (CI) is one of the MVC frameworks available. Unlike legacy PHP technique, This framework use different URI format for sending and receive parameters. For example: if we use usual PHP technique, we will use URI like:

localhost/index.php?id=2

But in CI, the URI would be look like this:

localhost/index.php/welcome/2

Where index.php is the router, welcome is the controller, and 2 is the parameter given to the welcome controller. It’s because of its design pattern, the MVC (Model-View Controller).

After some reads, there were a lot of discussion on removing the “index.php” in CI forum. And I’ve been spending my time just to figure it out. I found some good resources at CodeIgniter Wikis, and after some trial-and-error, finally it works for me. This is how I do it:

  1. I created .htaccess file and put it on my CI installation folder. If you used Windows, you could use Save As… menu from Notepad to create this file.
    My CI installation folder was www/igniter, so I put the .htaccess file on this folder. And this is my .htaccess file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /igniter
    
    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #‘system’ can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php/$1 [L]
    
    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn’t true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    #This last condition enables access to the images and css folders, and the robots.txt file
    #Submitted by Michael Radlmaier (mradlmaier)
    RewriteCond $1 !^(index\.php|images|robots\.txt|css)
    RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>
    
    <IfModule !mod_rewrite.c>
    # If we don’t have mod_rewrite installed, all 404’s
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin
    
    ErrorDocument 404 /index.php
    </IfModule>

    I just copy-paste the code from CI’s Wiki and modified the RewriteBase into my CI installation folder (in my case: igniter)

  2. Then, I opened the system/application/config/config.php file. I modified the $config['index_page'] from
    $config['index_page'] = "index.php";

    into

    $config['index_page'] = '';
  3. I activated mod_rewrite on the Apache. I opened the httpd.conf file and delete the # character in front of:
    LoadModule rewrite_module modules/mod_rewrite.so
  4. I didn’t need to modified the directory section of httpd.conf file. Maybe it had been already configured by the Apache.

And it works for me. The URI now without the index.php segment. I implemented all of the configuration above on Windows using Wamp. I tried it on Linux too, but so far It didn’t work. I’ll tell you later if I make it.

Conecting to DSL from Ubuntu 8.10

05/02/2009

Finally, my Ubuntu shipping has arrived yesterday. Without waiting, I installed this OS to my machine. You know, open source OS like Linux, depends on its repositories in the clouds. So, I figured it out how to connect via my DSL internet connection using this distribution. This is how I do it:

  1. Turn on your modem and plug in your LAN Cable from modem to your ethernet device.
  2. Right click your Network Manager Applet (located on top right of your Ubuntu desktop) and click on Edit Connection.
  3. Pick the DSL tab and Click on the Add button.
  4. A window will appear, and on the DSL tab enter your username, service name, and password.

    I’m on Indonesia, and using Telkom Speedy service. So this is my configuration:
    Connection Name: Speedy
    Username: myusername@telkom.net
    Service: speedy
    Password: myspeedypassword

  5. Click OK when you’re done, and exit the Network Manager.
  6. Next, left clik on the Network Manager Applet and click on connection name we configured on previous step. In my case, the connection name was Speedy.
  7. Wait until they connecting to the server, and when it’s done, there you go,, you’ve been connected.

Go ahead and try it. I’m waiting for your comment.

Waiting for OS

01/02/2009

Really, when campus’s license now gone, I was thinking about finding some alternatives. There were two OS that caught my attention.

The first one: Ubuntu. Who doesn’t know this the DistroWatch’s most-popular-linux-distribution? It’s simple, easy to use, and has great repositories. I’ve been using this OS for almost two years now, and it’s just get better on every new version released. Because of my bandwidth limitation, I ordered a copy of it last month. It hasn’t arrive yet (since I write this).

The second OS that made me curious was OpenSolaris. It has unique features like ZFS and Time Slider. I really want to try it. Even it still young, it’s already a worthy opponent of Ubuntu. I’ve ordered a copy too, but same as Ubuntu, it hasn’t arrived yet.

I think I’ll just be patient and wait. Hope they will come soon..

New Tutorial Site: Indonesian Way

27/01/2009

While I was being jobless right now, I met some of my old gangs back in highschool. Luckily for me, they were computer-addict, just like me. We (me and Danu) did some chat and agreed to build a tutorial site: for dummies and in Indonesian. At least, this is we could do to contribute in Indonesian education.

The next conference was a mess. You know, when old friends met, they would tell you a lot of untold story, like him now engaged with her or where is he right now, how she is doing now, etc. Need some time to get them to focus about the site. But finally, after some efforts, we could get back to the topic.

We talked about the domain name for our new site. This is the most important and hardest part. It’s about the identation of our site. It should be short, meaningful, catchy, and zero-typo-possibility. Some ideas swinging around. From tutorial12.web.id, belajar.web.id, kuliah.web.id (what?), even x12community (with regards to Mijil, one of the friend involved). But then one word from Sasi silenced the conference. GIMANA. Simple, catchy, questionable, error-free, funky. Next, we agreed to buy “gimana.web.id” domain. Just a moment after the conversation, I registered for gimana.web.id.

One step done, next step: host hunting.

Page 10 of 15« First...89101112...Last »